mcpField
S
swiftui-advanced

swiftui-advanced

github.com/johnrogersDevelopment233164 installsUpdated 40w ago
Repository

About swiftui-advanced

A reference skill for advanced SwiftUI development, covering gesture composition, adaptive layouts, architecture choices, and performance. It helps developers select patterns and check common pitfalls for their app's needs.

Key features

  1. 01Composing simultaneous and sequenced gestures
  2. 02Choosing adaptive layout techniques
  3. 03Selecting architecture by app complexity
  4. 04Optimizing view body calculations
  5. 05Profiling with Instruments 26

Use cases

  1. 01Combining gestures with defined precedence
  2. 02Adapting layouts to available space
  3. 03Choosing an architecture for a new app
  4. 04Investigating unnecessary view updates

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/johnrogers/claude-swift-engineering --skill swiftui-advanced

After installing, type/swiftui-advancedin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
adaptive-layout.md
architecture.md
gestures.md
performance.md

Details

From the project README

SwiftUI Advanced

Advanced SwiftUI patterns for gesture composition, adaptive layouts, architecture decisions, and performance optimization.

Reference Loading Guide

ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.

ReferenceLoad When
GesturesComposing multiple gestures, GestureState, custom recognizers
Adaptive LayoutViewThatFits, AnyLayout, size classes, iOS 26 free-form windows
ArchitectureMVVM vs TCA decision, State-as-Bridge, property wrapper selection
PerformanceInstruments 26, view body optimization, unnecessary updates

Core Workflow

  1. Identify pattern category from user's question
  2. Load relevant reference for detailed patterns and code examples
  3. Apply pattern following the decision trees and anti-patterns
  4. Verify using provided checklists or profiling guidance

Decision Trees

Gesture Composition
  • Both gestures at same time? -> .simultaneously
  • One must complete before next? -> .sequenced
  • Only one should win? -> .exclusively
Layout Adaptation
  • Pick best-fitting variant? -> ViewThatFits
  • Animated H/V switch? -> AnyLayout
  • Need actual dimensions? -> onGeometryChange
Architecture Selection
  • Small app, Apple patterns? -> @Observable + State-as-Bridge
  • Complex presentation logic? -> MVVM with @Observable
  • Rigorous testability needed? -> TCA

Common Mistakes

  1. Gesture composition order matters — .simultaneously and .sequenced have different trigger timing. Swapping them silently changes behavior. Understand gesture semantics before using.

  2. ViewThatFits over-used — ViewThatFits remeasures on every view change. For animated H/V switches, use AnyLayout instead. Use ViewThatFits only for static variant selection.

  3. onGeometryChange triggering unnecessary updates — Reading geometry changes geometry, which triggers updates, which changes geometry... circular. Use .onGeometryChange only with proper state management to avoid loops.

  4. Architecture mismatch mid-project — Starting with @Observable + State-as-Bridge then realizing you need TCA is expensive. Choose architecture upfront based on complexity (small app = @Observable, complex = TCA).

  5. Ignoring view body optimization — Computing expensive calculations in view body repeatedly kills performance. Move calculations to properties or models. Profile with Instruments 26 before optimizing prematurely.

Comments

Markdown supported