~/talk

Async/await in Swift

Talkat code.talks 2022 · 2022-09-15..09-16· [swift]
slides:none on file

Async/await is available in Swift 5.5+ (Xcode 13/14) and converts nested completion-handler code into straightline calls, demonstrated by a URLSession article fetch, JSON decoding and image extraction that become simple await/try returns. Xcode offers a refactor to convert callbacks to async, and legacy callbacks are wrapped with checkedContinuation to bridge APIs. SwiftUI uses the task view modifier and Task contexts to call async methods and Firebase functions map to async automatically via Swift Evolution 0297.

AI-written summary · about

  1. 0:00Intro
  2. 1:14Asynchronous code is everywhere
  3. 4:10Let's add some error handling...
  4. 8:22Let's convert a callback-based function!
  5. 11:47Sometimes, it's more complicated, though
  6. 15:23await: only from within async context
  7. 19:53Firebase and async/await
~/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.