Diagnose and fix SwiftUI rendering bottlenecks through code review, Instruments profiling, and targeted remediation.
Works with
Covers view invalidation storms, unstable list identity, expensive body computations, layout thrash, and image decoding issues with concrete code examples and fixes
Includes step-by-step Instruments profiling workflow using the SwiftUI template to identify high body-evaluation counts and CPU hotspots
Explains identity and lifetime mechanics, lazy loading patterns, and
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionswiftui-performanceExecute the skills CLI command in your project's root directory to begin installation:
Fetches swiftui-performance from dpearson2699/swift-ios-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate swiftui-performance. Access via /swiftui-performance in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
372
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
372
stars
Audit SwiftUI view performance end-to-end, from instrumentation and baselining to root-cause analysis and concrete remediation steps.
Collect:
Focus on:
id churn, UUID() per render).if/else returning different root branches).body (formatting, sorting, image decoding).GeometryReader, preference chains).Provide:
Explain how to collect data with Instruments:
Ask for:
Prioritize likely SwiftUI culprits:
id churn, UUID() per render).if/else returning different root branches).body (formatting, sorting, image decoding).GeometryReader, preference chains).Summarize findings with evidence from traces/logs.
Apply targeted fixes:
@State/@Observable closer to leaf views).ForEach and lists.body (precompute, cache, @State).equatable() or value wrappers for expensive subtrees.Look for these patterns during code review.
bodyvar body: some View {
let number = NumberFormatter() // slow allocation
let measure = MeasurementFormatter() // slow allocation
Text(measure.string(from: .init(value: meters, unit: .meters)))
}
Prefer cached formatters in a model or a dedicated helper:
final class DistanceFormatter {
static let shared = DistanceFormatter()
let number = NumberFormatter()
let measure = MeasurementFormatter()
}
var filtered: [Item] {
items.filter { $0.isEnabled } // runs on every body eval
}
Prefer precompute or cache on change:
@State private var filtered: [Item] = []
// update filtered when inputs change
body or ForEach// DON'T: sorts or filters on every body evaluation
ForEach(items.sorted(by: sortRule)) { item in Row(item) }
ForEach(items.filter { $0.isEnabled }) { item in Row(item) }
Prefer precomputed, cached collections with stable identity. Update on input change, not in body.
ForEach(items, id: \.self) { item in
Row(item)
}
Avoid id: \.self for non-stable values; use a stable ID.
var content: some View {
if isEditing {
editingView
} else {
readOnlyView
}
}
Prefer one stable base view and localize conditions to sections/modifiers (for example inside toolbar, row content, overlay, or disabled). This reduces root identity churn and helps SwiftUI diffing stay efficient.
Image(uiImage: UIImage(data: data)!)
Prefer decode/downsample off the main thread and store the result.
@Observable class Model {
var items: [Item] = []
}
var body: some View {
Row(isFavorite: model.items.contains(item))
}
Prefer granular view models or per-item state to reduce update fan-out.
Ask the user to re-run the same capture and compare with baseline metrics. Summarize the delta (CPU, frame drops, memory peak) if provided.
Provide:
Instruments ships with a dedicated SwiftUI template (available in Xcode 15+ / Instruments 15+). This template provides:
body is evaluated.@State, @Binding, and @Observable property changes that trigger view updates.body computations.In the SwiftUI instrument lane, each row represents a view type. Key signals:
body (formatting, sorting, image work).Add Self._printChanges() in Debug builds to log exactly which property triggered a view update:
var body: some View {
#if DEBUG
let _ = Self._printChanges() // prints: "MyView: @self, _count changed."
#endif
Text("Count: \(count)")
}
Remove _printChanges() before submitting to the App Store -- it is a debug-only API.
When Time Profiler shows significant time in a view's body:
NumberFormatter(), DateFormatter()), collection operations (.sorted(), .filter()), or image decoding.onChange, task, or precomputed @State.SwiftUI assigns every view an identity used to track its lifetime, state, and animations.
body to distinguish views..id(_:) modifier or ForEach(items, id: \.stableID).// Structural identity: SwiftUI knows these are different views by position
VStack {
Text("First") // position 0
Text("Second") // position 1
}
When a view's identity changes, SwiftUI treats it as a new view:
@State is reset.onAppear fires again.When identity stays the same, SwiftUI updates the existing view in place, preserving state and providing smooth transitions.
AnyView erases type information, forcing SwiftUI to fall back to less efficient diffing:
// DON'T: AnyView destroys type identity
func makeView(for item: Item) -> AnyView {
if item.isPremium {
return AnyView(PremiumRow(item: item))
} else {
return AnyView(StandardRow(item: item))Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
anthropics/claude-code
mblode/agent-skills
github/awesome-copilot
sickn33/antigravity-awesome-skills
leonxlnx/taste-skill
erichowens/some_claude_skills
We added swiftui-performance from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Registry listing for swiftui-performance matched our evaluation — installs cleanly and behaves as described in the markdown.
Solid pick for teams standardizing on skills: swiftui-performance is focused, and the summary matches what you get after install.
swiftui-performance reduced setup friction for our internal harness; good balance of opinion and flexibility.
Useful defaults in swiftui-performance — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend swiftui-performance for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
We added swiftui-performance from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Keeps context tight: swiftui-performance is the kind of skill you can hand to a new teammate without a long onboarding doc.
swiftui-performance fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Keeps context tight: swiftui-performance is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 74