Gestures (tvOS)
tvOS does NOT support touch gestures. All input comes from the Siri Remote.
Siri Remote Commands
DIRECTIONAL INPUT:
.onMoveCommand { direction in
switch direction {
case .up: moveUp()
case .down: moveDown()
case .left: moveLeft()
case .right: moveRight()
@unknown default: break
}
}
PLAY/PAUSE BUTTON:
.onPlayPauseCommand {
togglePlayback()
}
MENU/BACK BUTTON:
.onExitCommand {
dismiss()
}
SELECT (CLICK) BUTTON:
- Handled automatically by Button tap actions
- Use
.onTapGestureonly for non-button focusable views
LONG PRESS:
.onLongPressGesture(minimumDuration: 0.5) {
showContextOptions()
}
Swipe Recognition (Siri Remote touchpad)
.gesture(
DragGesture(minimumDistance: 50)
.onEnded { value in
if abs(value.translation.width) > abs(value.translation.height) {
if value.translation.width > 0 {
swipeRight()
} else {
swipeLeft()
}
}
}
)
NOT Available on tvOS
- No pinch gestures
- No rotation gestures
- No multi-touch
- No 3D Touch / Force Touch
- No pencil input
- No drag and drop
Rules
- Primary interaction is focus movement + select — not swipe
- Use
onMoveCommandfor directional navigation, not drag gestures - Always handle
onExitCommandfor back navigation - Siri Remote swipes are secondary — focus navigation is primary
- All interactive elements must work with focus + select pattern
Scan to join WeChat group