Building a SwiftUI App with Claude Code: What Works and What Doesn't
Short answer: Claude Code is strong at writing SwiftUI views, data models, networking and business logic, and it can build and test from the command line with xcodebuild. It is weaker with Xcode project files, signing, Swift concurrency edge cases and visual verification. Give it a clean project structure, a build command and real-device testing by humans.
On this page
Can Claude Code build a native SwiftUI app?
Yes, and the results are often surprisingly good. SwiftUI is declarative and compact, so a view and its state fit in a single file the agent can reason about. Claude Code writes clean view hierarchies, view models, Codable models, async networking layers and unit tests with little guidance.
The friction is around the code rather than in it. iOS development depends on Xcode, a project file format that is hard to edit by text, a simulator that needs visual inspection, and a signing system tied to your Apple account. Knowing which side of that line a task falls on is the key to a productive workflow.
What works well
These tasks usually succeed on the first or second attempt when the project is set up properly.
- New screens and components from a written description or a screenshot of a design.
- Data models with Codable, SwiftData or Core Data entities and migrations of simple schemas.
- Networking layers using URLSession and async/await, including error handling and retries.
- Refactoring large views into smaller components and extracting view models.
- Unit tests for business logic, formatters and parsing code.
- Localization files, accessibility labels and Dynamic Type support when explicitly requested.
What does not work well, and how to compensate
Editing the .xcodeproj file is the classic stumbling block. When Claude Code adds files, they may not be part of the target, and manual edits to the project file can corrupt it. A Swift Package for most of the code, or a project generator such as XcodeGen or Tuist, turns the project into readable configuration the agent can maintain. Recent Xcode versions with folder-based groups also reduce the problem.
Swift concurrency is the second area. Agents sometimes scatter @MainActor annotations or wrap calls in tasks to silence compiler warnings rather than fixing data races. With strict concurrency checking, insist that warnings are resolved properly and review actor isolation by hand.
Third, visual correctness. The agent cannot reliably judge whether a layout looks right on an iPhone SE and a Pro Max, in dark mode, with large text. SwiftUI previews and snapshot tests help, but a human still needs to look at the app on real devices.
Need a hand? apprat.io helps with exactly this. Book a call for free and get a clear plan in 15 to 30 minutes.
A workflow that keeps Claude Code productive
Give the agent a closed feedback loop so it can verify its own work before handing it back.
- Document architecture, minimum iOS version and coding conventions in CLAUDE.md.
- Provide a single build command using xcodebuild for a specific simulator and a test command the agent must run.
- Keep business logic in a Swift Package so it can be tested without launching the app.
- Ask for small, reviewable changes per task instead of whole features in one pass.
- Review diffs for concurrency, memory and API usage before merging.
- Test every release build on at least two physical devices before distribution.
Apple frameworks and the knowledge gap
Apple releases new APIs every year, and older ones get deprecated. Claude Code knows SwiftUI well up to its training data, but may default to older patterns such as ObservableObject where the newer Observation framework is preferred, or miss the latest navigation APIs. State the minimum deployment target and preferred patterns explicitly, and paste relevant documentation into the session when using new frameworks.
Frameworks with complex entitlements, such as HealthKit, StoreKit, push notifications, App Intents or widgets, need capabilities configured in the developer account and project. Claude Code can write the code, but someone has to configure the capabilities and test on device, because many of these features do not work fully in the simulator.
When to add human AI Code Engineers
Solo builders can get far with Claude Code and SwiftUI. Problems start when the app has paying users: a crash on a specific iOS version, an in-app purchase edge case, a review rejection or a refactor that touches dozens of files. These need someone who reads Swift fluently and owns the outcome.
apprat.io combines coding agents with named senior AI Code Engineers who plan, review every change, test on real iPhones and iPads and publish to the App Store. The Claude Code-to-App module takes over existing SwiftUI projects, including project file cleanup, concurrency fixes and release setup, so you keep the speed of the agent without the risk of unreviewed code.
With apprat.io you can start with a 30-day free trial and plans from 129 EUR per month including AI Code Engineer hours. If you are deciding whether your SwiftUI project needs that support, a free call is a quick way to find out.
Frequently asked questions
Can Claude Code run the iOS simulator?
Claude Code can build the app and run tests on a simulator through xcodebuild and simctl commands on a Mac. It can read build errors and test results, but it cannot reliably judge visual layout. Combine automated tests with human review of the running app on devices.
Should I use SwiftUI or UIKit for an app built with Claude Code?
SwiftUI is usually the better choice for new apps because it is concise and declarative, which suits coding agents. UIKit remains useful for specific components or legacy code. Mixed projects work fine if CLAUDE.md states which framework to use where.
How do I stop Claude Code from breaking the Xcode project file?
Move most code into Swift Packages, use a project generator like XcodeGen or Tuist, or rely on folder-based groups in recent Xcode versions. Ask the agent to never edit the project file by hand and to verify every change with a build command.
Is code from Claude Code good enough for App Store apps?
It can be, if it is reviewed and tested. Typical issues are concurrency shortcuts, missing edge cases and outdated APIs. A review step on every change and testing on physical devices close most of these gaps before they reach users.
