Some Simple Values in Swift

Number

1
2
3
4
var myNum = 1
myNum = 2
let myConstant = 3
let radius: Double = 1.25

String

1
2
3
4
var greeting = "Hello, I'm"
var age: Int = 24
let myGreeting: String = greeting + String(age)
let anotherGreeting: String = "Hi. I'm \(age) years old".

Multiline String

1
2
3
4
var quote = """
Is this the real life.
Is this just fantasy
"""

Array

1
2
3
4
5
6
7
var fruits: [String] = ["banana", "orange"]
var studentsAge: [String:Int] = [
    "Tom": 24,
    "Max": 22,
    "Alice": 23,
]
var noEle = [String]()