~/talk

Getting Focus Right on Apple Platforms

Talkat iOS Conf SG 2024 · 2024-01-18..01-19· [swift, frontend-architecture]
slides:none on file

A tvOS app is built: a vehicle grid and a track preview that updates as focus changes. Focusable views use the SwiftUI focusable modifier and default controls get effects automatically; custom views need an explicit effect. Adjacency rules cause missing jumps and get fixed by declaring a header as a focusSection modifier to widen the target. Per-item focus uses FocusState with a hashable Vehicle, promoted to app scope with the focusedValue property wrapper, and initial focus uses a namespace plus prefersDefaultFocus.

AI-written summary · about

  1. 0:00Focus on Apple platforms
  2. 1:05Focus as cursor alternative
  3. 3:34Default focusable elements
  4. 5:23Custom focus effects
  5. 6:51Demo: Focus app for toddlers
  6. 8:18Focus versus selection
  7. 9:24Focus movement directions
  8. 10:09Fixing focus sections
  9. 13:02Track preview feature
  10. 14:26FocusState API
  11. 17:15Tracking focused element
  12. 19:24Sharing focus state
  13. 26:54Default focus on launch
  14. 28:23prefersDefaultFocus modifier
  15. 31:54Focus on iPad vs tvOS
  16. 34:02Keyboard navigation on iPadOS
  17. 36:11Q&A
~/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.