Implementing Switch Control Support in Mobile Applications
Switch Control (iOS) and Switch Access (Android) — technologies for device control through external switch: button, pedal, breath sensor. Used by people with limited motor skills who can't interact with touchscreen.
Mechanics: system sequentially highlights interface elements (scanning); user activates switch at right moment. Second switch — either select element or enter submenu of actions.
What's Needed for Support
iOS — Switch Control
Switch Control uses same accessibility tree as VoiceOver. If VoiceOver works correctly — Switch Control usually works too. But there are nuances.
Element grouping. During scanning system first highlights groups (containers), then enters inside. If product card not grouped as single element — Switch Control goes through each subview sequentially: image, name, price, button. Too many steps for one action.
accessibilityElements on container + accessibilityActivate() override for custom action — reduce scanning steps.
Custom gestures. Swipe card to delete — standard UIKit UISwipeGestureRecognizer won't trigger Switch Control. Need to add UIAccessibilityCustomAction:
let deleteAction = UIAccessibilityCustomAction(
name: "Delete",
target: self,
selector: #selector(deleteItem)
)
accessibilityCustomActions = [deleteAction]
Custom Actions appear in Switch Control menu when element is activated.
Scanning style. By default — autoscanning (elements highlight automatically). User can enable manual scanning. Ensure focus doesn't "stick" in endless loop inside one container.
Android — Switch Access
Switch Access configured via Settings → Accessibility → Switch Access. Two main modes: Linear Scanning (sequential traversal) and Row-Column Scanning (rows first, then columns).
android:focusable="true" and correct android:nextFocusDown/Up/Left/Right — define navigation order. Without explicit nextFocus attributes system builds order by screen position — can be illogical for complex layout.
In Compose: Modifier.focusRequester() and Modifier.focusOrder { down = nextFocusRequester } — programmatic focus order control for Switch Access.
Custom actions similar to iOS: ViewCompat.setAccessibilityDelegate with overridden onInitializeAccessibilityNodeInfo — add AccessibilityActionCompat for non-standard operations.
Testing Without Real User
On iOS: Settings → Accessibility → Switch Control → Add New Switch → Screen → Full Screen. Now tap on screen = switch activation. Can check scanning flow independently.
On Android: Settings → Accessibility → Switch Access → Use Volume Keys as Switches. Volume Up = move to next element, Volume Down = select.
Full testing requires real device — emulator doesn't support Switch Control/Access fully.
How Long This Takes
If VoiceOver/TalkBack already implemented — Switch Control usually works automatically. Main work — add UIAccessibilityCustomAction/AccessibilityActionCompat for gesture actions and check scanning order. 2-3 days. If accessibility tree not developed — start with VoiceOver/TalkBack audit.







