swiftship/internal/skills/data/always-visionos/layout/SKILL.md
visionOS layout patterns: window sizing, volume sizing, spatial depth, Dynamic Type. Use when working on visionOS layout, window management, or spatial arrangement. Triggers: layout, window, volume, sizing, defaultSize, depth.
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.
Windows have no fixed frame — use .defaultSize():
WindowGroup {
ContentView()
}
.defaultSize(width: 800, height: 600)
Volumes use 3D dimensions:
WindowGroup {
VolumetricContentView()
}
.windowStyle(.volumetric)
.defaultSize(width: 0.5, height: 0.5, depth: 0.5, in: .meters)
Use depth alignment for layered content:
ZStack {
BackgroundLayer()
ContentLayer()
.offset(z: 20)
ForegroundLayer()
.offset(z: 40)
}
GeometryReader { geometry in
let columns = geometry.size.width > 800
? [GridItem(.adaptive(minimum: 200))]
: [GridItem(.adaptive(minimum: 150))]
LazyVGrid(columns: columns) {
ForEach(items) { item in
ItemCard(item: item)
}
}
}
@Environment(\.dynamicTypeSize) var dynamicTypeSize
var body: some View {
VStack(spacing: AppTheme.Spacing.medium) {
Text(title)
.font(AppTheme.Fonts.headline)
Text(subtitle)
.font(AppTheme.Fonts.body)
}
.padding(AppTheme.Spacing.large)
}
visionOS windows have built-in safe areas:
VStack {
content
}
.padding() // Respect default window padding
UIScreen.main.bounds — windows are resizable.defaultSize() for initial window dimensions.defaultSize(width:height:depth:in:) for volumetric windowsoffset(z:) for depth-based layeringtesting
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.