swiftship/internal/skills/data/ui/performance/SKILL.md
Performance: LazyVStack, task modifiers, image caching, profiling. Use when implementing UI patterns related to performance.
npx skillsauth add abdullah4ai/apple-dev-docs performanceInstall 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.
Comprehensive guide to performance optimization, lazy loading, image handling, and concurrency patterns.
// BAD - triggers update even if value unchanged
.onReceive(publisher) { value in
self.currentValue = value
}
// GOOD - only update when different
.onReceive(publisher) { value in
if self.currentValue != value {
self.currentValue = value
}
}
// Good - pass specific values
struct SettingsView: View {
@State private var config = AppConfig()
var body: some View {
VStack {
ThemeSelector(theme: config.theme)
FontSizeSlider(fontSize: config.fontSize)
}
}
}
POD (Plain Old Data) views use memcmp for fastest diffing — only simple value types, no property wrappers.
// POD view - fastest diffing
struct FastView: View {
let title: String
let count: Int
var body: some View { Text("\(title): \(count)") }
}
Advanced: Wrap expensive non-POD views in POD parent views.
struct DataView: View {
@State private var data: [Item] = []
var body: some View {
List(data) { item in Text(item.name) }
.task {
data = await fetchData() // Auto-cancelled on disappear
}
}
}
// Good - narrow dependency
struct ItemRow: View {
let item: Item
let themeColor: Color // Only depends on what it needs
var body: some View {
Text(item.name).foregroundStyle(themeColor)
}
}
AsyncImage(url: imageURL) { phase in
switch phase {
case .empty:
ProgressView()
case .success(let image):
image
.resizable()
.aspectRatio(contentMode: .fit)
case .failure:
Image(systemName: "photo")
.foregroundStyle(.secondary)
@unknown default:
EmptyView()
}
}
.frame(width: 200, height: 200)
Image(systemName: "star.fill")
.foregroundStyle(.yellow)
Image(systemName: "heart.fill")
.symbolRenderingMode(.multicolor)
// Animated symbols (iOS 17+)
Image(systemName: "antenna.radiowaves.left.and.right")
.symbolEffect(.variableColor)
testing
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.