Community-maintained Agent Skills for complete Swift and Apple-platform app delivery.
72
90%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Medium
Suggest reviewing before use
Runtime tools for diagnosing focus issues in UIKit and SwiftUI apps.
Docs: UIFocusDebugger
UIFocusDebugger is a runtime-only class for use in the LLDB console during
a debugging session. Do not call these methods from app code.
// Show current focus state
po UIFocusDebugger.status()
// Check why a specific view can't receive focus
po UIFocusDebugger.checkFocusability(for: myButton)
// Show focus group hierarchy
po UIFocusDebugger.focusGroups(for: myViewController)
// Show preferred focus chain
po UIFocusDebugger.preferredFocusEnvironments(for: myViewController)
// Simulate a focus update from a given environment
po UIFocusDebugger.simulateFocusUpdateRequest(from: myViewController)"Why won't this view focus?"
po UIFocusDebugger.checkFocusability(for: myView)Common causes returned:
canBecomeFocused returns falseshouldUpdateFocus(in:) returned false"Where does focus go next?"
po UIFocusDebugger.simulateFocusUpdateRequest(from: currentView)Shows the focus engine's evaluation of the next destination based on geometry.
SwiftUI does not expose UIFocusDebugger directly. Strategies:
.onChange(of: focusedField) to log focus transitions:.onChange(of: focusedField) { old, new in
print("Focus moved: \(String(describing: old)) → \(String(describing: new))")
}Use Accessibility Inspector (Xcode → Open Developer Tool) to inspect focus order and accessibility element hierarchy.
Set breakpoints in didUpdateFocus(in:with:) for UIKit-hosted views
within SwiftUI.
| Anti-Pattern | Problem | Fix |
|---|---|---|
Programmatically setting focus in viewDidLoad | Focus engine hasn't completed initial update | Use viewDidAppear or Task { @MainActor in } |
Calling setNeedsFocusUpdate() without updateFocusIfNeeded() | Focus update is deferred indefinitely | Pair both calls: setNeedsFocusUpdate(); updateFocusIfNeeded() |
Overriding preferredFocusEnvironments with stale references | Focus targets a deallocated or off-screen view | Return currently valid, on-screen environments |
Using isHidden = true to disable focus on a view | Removes the view from layout entirely | Use canBecomeFocused override or focusable(false) |
Animating focus changes without UIFocusAnimationCoordinator | Animation doesn't sync with system focus animation | Use coordinator.addCoordinatedFocusingAnimations |
Forgetting collisionComponent on RealityKit entities | Entity can't receive gaze/direct-touch input or hover feedback in visionOS | Add CollisionComponent alongside InputTargetComponent |
| Not testing with Full Keyboard Access on macOS | Tab focus skips custom controls | Enable Keyboard Navigation in System Settings and test |
| Relying on touch-based interactions on tvOS | No touch input available | Make all actions accessible via focus + select |
.tessl-plugin
skills
accessorysetupkit
references
activitykit
adattributionkit
references
alarmkit
references
app-clips
app-intents
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
audioaccessorykit
references
authentication
references
avfoundation-audio
references
avkit
background-processing
references
browserenginekit
callkit
references
carplay
cloudkit
contacts-framework
references
core-bluetooth
references
core-data
core-haptics
references
core-motion
references
core-nfc
references
coreml
references
cryptokit
cryptotokenkit
debugging-instruments
device-integrity
references
energykit
references
eventkit
family-controls
references
financekit
focus-engine
gamekit
git-branching-workflow
references
healthkit
references
homekit
references
ios-accessibility
ios-app-workflow
references
ios-ettrace-performance
ios-localization
ios-memgraph-analysis
ios-networking
ios-simulator
references
metrickit
references
musickit
references
natural-language
paperkit
references
passkit
references
pdfkit
pencilkit
references
permissionkit
references
photokit
push-notifications
quicklook
references
realitykit
references
relevancekit
references
scenekit
sensorkit
shazamkit
references
speech-recognition
references
spritekit
storekit
swift-api-design-guidelines
swift-architecture
references
swift-charts
swift-codable
references
swift-code-review
swift-concurrency
swift-formatstyle
references
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-responsive-layout
swiftui-uikit-interop
swiftui-webkit
tabletopkit
tipkit
vision-framework
weatherkit
references