Var vs Let
let pi = 3.14
var score = 0
Optionals
var name: String?
if let val = name { print(val) }
Closures
let doubled = list.map { $0 * 2 }
Structs
struct User {
var id: Int
var name: String
}
Switch
switch x {
case 1: print("One")
default: break
}
Protocols
protocol Drawable { func draw() }