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








