~/talk

To be! Or not? Optionals in practice

Talkat iOS Conf SG 2017 · 2017-10-19..10-20· [ios]
slides:none on file

Practical rules for Swift optionals: prefer non-optional values and use empty collections/strings instead of nil, because most fields aren’t truly optional; treat optional Bool as three-state configuration only when needed; prefer letting UI code convert UITextField.text once rather than spreading optionals; use an explicit Result type (success or error) instead of data+error pairs; force-unwrap only with deliberate intent (crash in dev, recover in release); keep implicitly unwrapped optionals rare (IBOutlets, certain delegate patterns) and unwrap early to reduce scattered checks.

AI-written summary · about

  1. 0:00Intro
  2. 0:56Whats an optional
  3. 6:50Collections
  4. 8:22Defaults
  5. 15:15ForceUnwrap
  6. 20:16Implicit Unwrapping
  7. 31:53Optional ints
  8. 35:49Summary
  9. 36:52Questions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.