| Section | Title |
|---|---|
| 1 | The Optional Type |
| 2 | Null |
| 3 | Unwrapping Optionals |
| 4 | Optional Pointers |
| 5 | Optionals Versus Errors |
| 6 | Exercises |
The Optional TypeSometimes a value may or may not exist.
Nullnull is the value used when an optional has no payload.
Unwrapping OptionalsAn optional value cannot be used as the payload type until it is unwrapped.
Optional PointersPointers are often optional.
Optionals Versus ErrorsOptionals and errors both describe a value that may not be produced.
ExercisesExercise 9-17. Declare an optional integer.