swiftship/internal/skills/data/always-tvos/layout/SKILL.md
tvOS layout patterns: focus-driven layout, large-screen content grids, 16:9 safe area, shelf-based browsing. Use when working on tvOS view layouts, content arrangement, or adapting UI for the big screen. Triggers: layout, grid, shelf, LazyVGrid, focus section.
npx skillsauth add abdullah4ai/apple-developer-toolkit layoutInstall 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.
SHELF / HORIZONTAL SCROLL (most common tvOS pattern):
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 40) {
ForEach(items) { item in
Button {
select(item)
} label: {
ItemCard(item: item)
}
.buttonStyle(.card)
}
}
.padding(.horizontal, 80)
}
CONTENT GRID:
LazyVGrid(columns: [
GridItem(.adaptive(minimum: 250), spacing: 40)
], spacing: 40) {
ForEach(items) { item in
Button {
select(item)
} label: {
ItemCard(item: item)
}
.buttonStyle(.card)
}
}
.padding(.horizontal, 80)
FULL-WIDTH HERO / BANNER:
VStack(alignment: .leading, spacing: 20) {
// Hero image
Image(item.heroImage)
.resizable()
.aspectRatio(16/9, contentMode: .fill)
.frame(height: 400)
.clipped()
.focusable()
// Metadata row
HStack(spacing: 24) {
Text(item.title)
.font(AppTheme.Fonts.title)
Text(item.subtitle)
.foregroundStyle(.secondary)
}
.padding(.horizontal, 80)
}
Use .focusSection() to group focusable elements:
VStack(spacing: 60) {
// Section 1
VStack(alignment: .leading) {
Text("Trending")
.font(AppTheme.Fonts.title3)
.padding(.horizontal, 80)
ShelfRow(items: trending)
}
.focusSection()
// Section 2
VStack(alignment: .leading) {
Text("New Releases")
.font(AppTheme.Fonts.title3)
.padding(.horizontal, 80)
ShelfRow(items: newReleases)
}
.focusSection()
}
| Element | Spacing | |---------|---------| | Between sections | 60pt | | Between cards | 40pt | | Horizontal padding | 80pt | | Between text lines | 12-20pt |
NavigationSplitView three-column layout — use tab + shelf pattern.safeAreaInset bottom bar — tvOS has no bottom bar conceptGeometryReader for rotation — tvOS is always landscapeButton, .focusable()).buttonStyle(.card) for media card interactions.focusSection() for predictable focus movementtesting
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.