Commit 82623c9
authored
Expand and reframe discussion of optionals (#143)
- Reframe the discussion of optional unwrapping to not conceptually rely
on force unwrapping.
- Highlight the value of non-optional types *never* being nil, and how
you can't forget to handle nil on an optional.
- Explicitly list the ways you can handle a `nil` value, and briefly
introduce the `??` operator.
- Explain when you should consider using force unwrapping.
- Reduce the comparison to C and Objective-C.
- Fix some mis-use of note boxes, where they were highlighting
information instead of asides that readers can choose to skip.
Fixes: rdar://410147492 files changed
+162
-96
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
| |||
0 commit comments