Ios swiftui architect

From Xopoko/build-swift-apps · View interactive version

Ios swiftui architect is an AI agent skill from the GitHub repository Xopoko/build-swift-apps. iOS SwiftUI views and components: build or refactor navigation, state ownership, async UI, sheets, previews, and responsive layouts; exclude UIKit-only and macOS work.

How to use this skill

Skill file

iOS SwiftUI Architect

Use for iOS SwiftUI UI structure and component choices. Read the nearest local example before introducing a new pattern.

Start

Rules

State Ownership

| Scenario | Pattern |

| --- | --- |

| Local UI state | @State |

| Child mutates parent value | @Binding |

| Root-owned iOS 17+ reference model | @State with @Observable |

| Injected iOS 17+ observable | explicit stored property |

| Shared service/config | @Environment(Type.self) |

| iOS 16 legacy model | @StateObject owner, @ObservedObject injected |

Choose ownership first; do not introduce a reference model when value state is enough.

New View Workflow

  1. Define state ownership, dependencies, and minimum OS.
  2. Sketch hierarchy, routing, and presentation; read navigation/sheet/deeplink refs when complex.
  3. Build and verify before widening call-site changes.
  4. Add async loading and explicit error/loading UI when needed.
  5. Add previews for primary/secondary states and accessibility IDs/labels for interactive UI.
  6. Validate build/previews/state propagation/list identity/observation scope. If build fails, fix the exact error before continuing.

Anti-Patterns

References

Use current Apple docs when API availability or platform guidance may have changed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.