~/talk

SwiftUI API Design Lessons:Bridging Procedural APIs with theDeclarativeWorld

Talkat try! Swift Tokyo 2025 · 2025-04-09..04-11· [swift, developer-experience]
github:niw
slides:none on file

Builds a working photo and video capture app using AVFoundation and an AVCaptureSession and shows that SwiftUI can represent session scope by preserving a session with AVCaptureSession lifecycle boxing. Child views emit configuration via PreferenceKey aggregation and the parent applies diffs to update inputs, outputs, and preview efficiently. Button actions use a passed proxy and async/await instead of persistent closures, avoiding callback identity problems. Full implementation is on GitHub as CaptureUI and the demo records and switches cameras successfully.

AI-written summary · about

  1. 0:00Introduction
  2. 0:44Camera app demo challenges
  3. 2:11Procedural approach
  4. 3:17SwiftUI-native camera API
  5. 3:59SwiftUI views as structures
  6. 4:45Session lifetime with state
  7. 7:15Inputs and outputs declarative
  8. 8:59Preference keys for communication
  9. 10:46Efficient config changes
  10. 11:51Capture triggers and callbacks
  11. 13:20Closure pitfalls
  12. 14:25SwiftUI API takeaways
  13. 15:50Closing and resources
~/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.