swiftship/internal/skills/data/always-tvos/tvos-patterns/SKILL.md
tvOS platform patterns: Siri Remote input handling, Top Shelf extensions, media playback, focus engine, parallax effects. Use when building tvOS-specific features, handling remote input, or implementing TV app patterns. Triggers: tvOS, Siri Remote, Top Shelf, AVPlayer, onMoveCommand, onPlayPauseCommand, focus engine.
npx skillsauth add abdullah4ai/apple-dev-docs tvos-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
tvOS uses the Siri Remote — all interaction is through focus and button presses:
// Handle directional movement
.onMoveCommand { direction in
switch direction {
case .up: moveUp()
case .down: moveDown()
case .left: moveLeft()
case .right: moveRight()
@unknown default: break
}
}
// Handle Play/Pause button
.onPlayPauseCommand {
togglePlayback()
}
// Handle Menu/Back button
.onExitCommand {
dismiss()
}
// Long press on select button
.onLongPressGesture {
showOptions()
}
import AVKit
struct PlayerView: View {
let url: URL
@State private var player: AVPlayer?
var body: some View {
VideoPlayer(player: player)
.onAppear {
player = AVPlayer(url: url)
player?.play()
}
.onDisappear {
player?.pause()
}
.ignoresSafeArea()
}
}
The only supported extension type on tvOS — shows content on the home screen:
// In Targets/TopShelf/ContentProvider.swift
import TVServices
struct TopShelfProvider: TVTopShelfProvider {
var topShelfStyle: TVTopShelfContentStyle { .sectioned }
var topShelfItems: [TVTopShelfSectionedItem] {
let section = TVTopShelfItemCollection(items: [
makeItem(id: "1", title: "Featured Movie", imageURL: url1),
makeItem(id: "2", title: "New Release", imageURL: url2),
])
section.title = "Featured"
return [section]
}
func makeItem(id: String, title: String, imageURL: URL) -> TVTopShelfSectionedItem {
let item = TVTopShelfSectionedItem(identifier: id)
item.title = title
item.setImageURL(imageURL, for: .screenScale1x)
item.displayAction = TVTopShelfAction(url: URL(string: "myapp://item/\(id)")!)
return item
}
}
tvOS automatically applies parallax effects to images in focused buttons:
// Images inside .buttonStyle(.card) get parallax automatically
Button { } label: {
Image("poster")
.resizable()
.aspectRatio(2/3, contentMode: .fill)
.frame(width: 200, height: 300)
}
.buttonStyle(.card)
struct SearchView: View {
@State private var query = ""
@State private var results: [Item] = []
var body: some View {
NavigationStack {
VStack {
// tvOS shows system keyboard for text input
TextField("Search", text: $query)
.onChange(of: query) { _, newQuery in
search(newQuery)
}
if results.isEmpty {
ContentUnavailableView.search(text: query)
} else {
ScrollView {
LazyVGrid(columns: [
GridItem(.adaptive(minimum: 200), spacing: 40)
], spacing: 40) {
ForEach(results) { item in
NavigationLink(value: item) {
ItemCard(item: item)
}
.buttonStyle(.card)
}
}
.padding(.horizontal, 80)
}
}
}
.navigationTitle("Search")
}
}
}
NavigationStack {
List {
Section("Account") {
NavigationLink("Profile") { ProfileView() }
NavigationLink("Subscriptions") { SubscriptionView() }
}
Section("Playback") {
Toggle("Auto-Play Next", isOn: $autoPlay)
Picker("Quality", selection: $quality) {
Text("Auto").tag(Quality.auto)
Text("High").tag(Quality.high)
Text("Low").tag(Quality.low)
}
}
Section("About") {
LabeledContent("Version", value: "1.0")
}
}
.navigationTitle("Settings")
}
onMoveCommand, onPlayPauseCommand, onExitCommand for remote controlAVKit for video playback — tvOS has deep system integrationtools
Apple platform skill for docs, WWDC lookup, App Store Connect work, and SwiftUI app generation. Use repo-local `node cli.js` for Apple docs and WWDC search, `appledev store` for App Store Connect workflows, and `appledev build` for app scaffolding or fix loops on macOS. USE WHEN: Apple APIs, WWDC sessions, TestFlight/App Store tasks, or building/fixing Apple-platform apps. DON'T USE WHEN: non-Apple platforms, generic backend work, or general web research. EDGE CASES: docs-only queries use `node cli.js` in this repo, not `appledev`; release workflows use `appledev store`; app scaffolding uses `appledev build`; rules-only requests can read `references/ios-rules/` or `references/swiftui-guides/` progressively without invoking binaries.
tools
All-in-one Apple developer skill with three integrated tools shipped as a single unified binary. (1) Documentation search across Apple frameworks, symbols, and 1,267 WWDC sessions from 2014-2025. No credentials needed. (2) App Store Connect CLI with 120+ commands covering builds (find/wait/upload), TestFlight, pre-submission validate, submissions, signing, subscriptions (family-sharable), IAP, analytics, Xcode Cloud, metadata workflows, release pipeline dashboard, insights, win-back offers, promoted purchases, product pages, nominations, accessibility declarations, pre-orders, pricing filters, localizations update, diff, webhooks with local receiver, workflow automation, and more. Requires App Store Connect API key. (3) Multi-platform app builder (iOS/watchOS/tvOS/iPad/macOS/visionOS) that generates complete Swift/SwiftUI apps from natural language with auto-fix, simulator launch, interactive chat mode, and open-in-Xcode. Requires an LLM API key and Xcode. Includes 38 iOS development rules and 12 SwiftUI best practice guides for Liquid Glass, navigation, state management, and modern APIs. All three tools ship as one binary (appledev). USE WHEN: Apple API docs, App Store Connect management, WWDC lookup, or building iOS/watchOS/tvOS/macOS/visionOS apps from scratch. DON'T USE WHEN: non-Apple platforms or general coding.
testing
watchOS complications: WidgetKit complication families, accessory sizes, timeline providers for watch face. Use when implementing watchOS-specific patterns related to widgets.
development
watchOS haptic feedback: WKInterfaceDevice preset haptic types for wrist-based feedback. Use when implementing watchOS-specific patterns related to haptics.