The Semantics of nil in Swift
The article explains that Swift’s nil differs from Objective‑C’s null pointer by representing ‘no value’ for any type through optionals, details how various optionals (Bool?, String?, class?, enum?) are encoded in memory, shows the extra byte cost for Int?, and advises minimizing optional Int fields in structs, using 0 when appropriate.