Operators
= (doesn't return a value, which prevents if x = y bugs)
+ - * / % (no implicit overflow: overflow traps at runtime) &+ &- &* (wrapping)
== != < > <= >=, identity === !== (class instances) condition ? a: b
a...b (closed), a..<b (half-open), a... / ...b / ..<b (one-sided) ~= (used by switch) is, as, as?, as!
Swift has no ++/-- (removed in Swift 3). Use += 1.
let remainder = -9 % 4 // -1
let isEven = 10.isMultiple(of: 2) // true
let maxValue = max(3, 7)
let wrapped = Int8.max &+ 1 // -128 (no trap)
let name: String? = nil
let display = name ?? "Anonymous"
for i in 1...3 { print(i) }
let slice = [10, 20, 30, 40][1...] // [20, 30, 40]
(1, "zebra") < (2, "apple") // tuple comparison: true