filmov
tv
Mastering Swift, arrays, dictionaries, sets, and enums.
Показать описание
📱 Welcome to my channel - Your Ultimate Destination for iOS Development! 🚀
🔍 Explore the World of iOS Development with Amandeep Singh!
We will cover Swift, arrays, dictionaries, sets, and enums. in this tutorial :-
/*
In Swift, arrays, dictionaries, sets, and enums are commonly used to organize and manipulate data. Here's a brief overview of each:
*/
//1. Arrays:
//An array is an ordered collection of values of the same type.
// Declaration
var numbers: [Int] = [1, 2, 3, 4, 5]
// Accessing elements
let firstElement = numbers[0]
// Modifying elements
numbers += [7, 8, 9]
// Iterating through elements
for number in numbers {
print(number)
}
//2. Dictionaries:
//A dictionary is an unordered collection of key-value pairs.
// Declaration
var person = ["name": "John", "age": 25, "isStudent": true] as [String : Any]
// Accessing values
let name = person["name"]
// Modifying values
person["age"] = 26
person["isStudent"] = false
// Iterating through key-value pairs
for (key, value) in person {
print("\(key): \(value)")
}
//3. Sets:
//A set is an unordered collection of unique values.
// Declaration
var uniqueNumbers: Set = [1, 2, 3, 4, 5]
// Adding and removing elements
// Performing set operations
let otherSet: Set = [4, 5, 6, 7, 8]
//4. Enums:
//An enum defines a common type for a group of related values.
// Declaration
enum CompassDirection {
case north
case south
case east
case west
}
// Using enums
var direction: CompassDirection = .south
switch direction {
case .north:
print("Heading north")
case .south:
print("Heading south")
case .east:
print("Heading east")
case .west:
print("Heading west")
}
🎉 Subscribe now for more videos on iOS development, and join our growing community of awesome enthusiasts! 🚀💙
🔔 Hit the notification bell so you never miss a moment – we've got more informative videos coming your way!
🤝 We value your feedback! Drop a comment below – share your thoughts, ideas, and what you want to see more of. This channel is for YOU! 🗣️💬
🚨 Don't forget to give this video a 👍 LIKE if you enjoyed it – it helps us a ton! Share it with your friends and family to spread the [positive vibes, knowledge, laughter]! 🌐👥
🌟 Thanks for being part of the family. Let's create something extraordinary together! 🌈✨
#Swift #Development #iOS #Xcode #iPhone tutorial for beginners #iOS Development #Swift Programming #App Development #User Interface #Auto Layout #Mobile App Design #UIKit #Mobile Development #Code Tutorial #SubscribeNow #JoinTheCommunity #AmandeepSinghChannel #Swift, #arrays, #dictionaries, #sets #enums.
🔍 Explore the World of iOS Development with Amandeep Singh!
We will cover Swift, arrays, dictionaries, sets, and enums. in this tutorial :-
/*
In Swift, arrays, dictionaries, sets, and enums are commonly used to organize and manipulate data. Here's a brief overview of each:
*/
//1. Arrays:
//An array is an ordered collection of values of the same type.
// Declaration
var numbers: [Int] = [1, 2, 3, 4, 5]
// Accessing elements
let firstElement = numbers[0]
// Modifying elements
numbers += [7, 8, 9]
// Iterating through elements
for number in numbers {
print(number)
}
//2. Dictionaries:
//A dictionary is an unordered collection of key-value pairs.
// Declaration
var person = ["name": "John", "age": 25, "isStudent": true] as [String : Any]
// Accessing values
let name = person["name"]
// Modifying values
person["age"] = 26
person["isStudent"] = false
// Iterating through key-value pairs
for (key, value) in person {
print("\(key): \(value)")
}
//3. Sets:
//A set is an unordered collection of unique values.
// Declaration
var uniqueNumbers: Set = [1, 2, 3, 4, 5]
// Adding and removing elements
// Performing set operations
let otherSet: Set = [4, 5, 6, 7, 8]
//4. Enums:
//An enum defines a common type for a group of related values.
// Declaration
enum CompassDirection {
case north
case south
case east
case west
}
// Using enums
var direction: CompassDirection = .south
switch direction {
case .north:
print("Heading north")
case .south:
print("Heading south")
case .east:
print("Heading east")
case .west:
print("Heading west")
}
🎉 Subscribe now for more videos on iOS development, and join our growing community of awesome enthusiasts! 🚀💙
🔔 Hit the notification bell so you never miss a moment – we've got more informative videos coming your way!
🤝 We value your feedback! Drop a comment below – share your thoughts, ideas, and what you want to see more of. This channel is for YOU! 🗣️💬
🚨 Don't forget to give this video a 👍 LIKE if you enjoyed it – it helps us a ton! Share it with your friends and family to spread the [positive vibes, knowledge, laughter]! 🌐👥
🌟 Thanks for being part of the family. Let's create something extraordinary together! 🌈✨
#Swift #Development #iOS #Xcode #iPhone tutorial for beginners #iOS Development #Swift Programming #App Development #User Interface #Auto Layout #Mobile App Design #UIKit #Mobile Development #Code Tutorial #SubscribeNow #JoinTheCommunity #AmandeepSinghChannel #Swift, #arrays, #dictionaries, #sets #enums.