Skip to content
Codex DesignBETA

SwiftUI UI Patterns skill for Codex.

The swiftui-ui-patterns skill gives Codex a set of default patterns for building and refactoring SwiftUI screens: how to own state, wire navigation and sheets, and split views into small parts. It comes with about 30 short references, one per component or topic. It ships in OpenAI’s Build iOS Apps plugin.

Updated November 12, 2026 · 3 min read

At a glance

Skill nameswiftui-ui-patterns
Comes withThe Build iOS Apps plugin, by OpenAI
Installcodex plugin add build-ios-apps@openai-curated, or /plugins in Codex
Codex uses itWhen you build or refactor SwiftUI UI: navigation, state, layouts, controls or how a screen is put together
Sourceopenai/plugins on GitHub

What it does

In an existing project, Codex first finds a nearby SwiftUI view in your repo and follows its conventions. In a new project, it starts from an app-wiring reference that sets up a TabView, NavigationStack and sheets, with route and sheet enums you extend as screens are added.

Its general rules:

  • State: the narrowest tool that fits, from @State and @Binding to @Observable models and @Environment for shared services. No view model when plain state is enough, with an ObservableObject fallback for iOS 16 and earlier.
  • Composition: small, focused subviews instead of one giant view.
  • Async work: .task with explicit loading and error states.
  • Sheets: .sheet(item:) over .sheet(isPresented:), and sheets dismiss themselves.
  • OS versions: the newest API that fits your deployment target, with the minimum OS called out.

It also lists anti-patterns to avoid, such as several booleans for mutually exclusive sheets, network calls inside body, and AnyView as a workaround. For a new view, Codex builds after each step and adds previews for the main states. The references cover lists, forms, grids, search, split views, the menu bar, macOS settings, haptics, theming, performance and more.

When to use it

Use it for everyday SwiftUI work, whether that’s a new screen, a tab structure or cleaning up a large view. It keeps Codex’s code in line with modern SwiftUI and with the patterns your app already uses.

Try it

Build a tabbed SwiftUI app shell
Use the swiftui-ui-patterns skill. Set up the app shell for a reading-list app: three tabs (Library, Search, Settings), each with its own NavigationStack, and an enum-driven sheet for adding a book. Add previews for the empty and loaded states.

Does it work in Claude Code?

Yes. The skill is plain instructions and Markdown references with no Codex-only tools, so you can copy the folder from GitHub into ~/.claude/skills.

Keep reading

An independent plugin for Codex. Not affiliated with or endorsed by OpenAI.