swiftui-architecture

Installation
SKILL.md

Modern SwiftUI Architecture

Concise entry point for pure SwiftUI architecture without ViewModels. Use the references for patterns, examples, and edge cases.

Scope

This skill covers SwiftUI views and their data flow.

When a request asks you to restructure UIKit or AppKit code, say that this guidance does not cover that code. Leave its internals alone. Answer at the boundary instead:

  • Wrap an existing view controller in UIViewControllerRepresentable to show it in SwiftUI.
  • Wrap an existing view in UIViewRepresentable only when a UIView is already separated from its controller.
  • Use UIHostingController for the opposite direction, to show a SwiftUI view inside UIKit.
  • On macOS, use NSViewControllerRepresentable, NSViewRepresentable, and NSHostingController in the same three roles.

Keep the wrapped code's state where it already lives. Pass the SwiftUI side's values into the wrapper. Send the wrapper's events back out through a callback.

Start Here

Installs
15
Repository
mintuz/skills
GitHub Stars
24
First Seen
Jan 24, 2026
swiftui-architecture — mintuz/skills