Claude Code + SwiftUI
In-app feedback for SwiftUI, fixed by Claude Code
You are building a SwiftUI app with Claude Code. Claude Code runs in your terminal next to your code, so it can run the CLI login, edit your project and read feedback in one session.
1. Paste one prompt into Claude Code
Open a terminal in your project folder, run claude, and paste the prompt at the Claude Code prompt.
Add Nitpick feedback to this app. Fetch https://nitpickhq.com/install.md and follow every step.Claude Code follows install.md. nitpick login opens your browser, where you create an account and start the subscription, and Claude Code waits for that before it adds the component.
In manual permission mode Claude Code asks before it runs a shell command, except for a built-in set of read-only commands. Choosing "Yes, and don't ask again" keeps that command allowed for the repository, and Shift+Tab switches the permission mode of the session.
2. What lands in your SwiftUI code
Roughly this. Claude Code writes it, you review it.
- Add the Swift package in Xcode with File > Add Package Dependencies, and put the Nitpick product in your app target.
- Check that the deployment target is iOS 17.0 or newer.
- Call Nitpick.configure once at launch, then name screens and elements.
import SwiftUI
import Nitpick
@main
struct MyApp: App {
init() { Nitpick.configure(appKey: "npk_YOUR_PUBLIC_KEY") }
var body: some Scene {
WindowGroup { RootView().nitpick() }
}
}
// Name what users may point at
Button("Start", action: start)
.nitpickElement("Home/StartButton")Needs iOS 17 or newer. The Swift package ships its own privacy manifest. Details in Install for SwiftUI.
3. Give Claude Code the MCP server
Claude Code adds a stdio server with a single command. Everything after the double dash is the server command and is passed through untouched.
claude mcp add nitpick -- npx -y @nitpickhq/cli mcpBy default the server is stored for the current project only (local scope, in ~/.claude.json). Add --scope project to write a .mcp.json file you can commit, or --scope user to have it in every project.
Run claude mcp list, or type /mcp inside a session to see whether the server is connected.
4. Build and run in the simulator with Claude Code
xcodebuild -list shows the schemes and builds one for a simulator, and xcrun simctl boots, installs and launches the app. Your scheme, simulator and bundle identifier will differ.
xcodebuild -list
xcodebuild -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 16' -derivedDataPath build build
xcrun simctl boot "iPhone 16"
xcrun simctl install booted build/Build/Products/Debug-iphonesimulator/MyApp.app
xcrun simctl launch booted com.example.myappIt runs xcodebuild and xcrun simctl itself. The first build shows a permission prompt; allow the command for the repository and the next builds go through without asking.
5. Let Claude Code fix the reports
Start a session in your project and say: check Nitpick for open feedback, fix what you can and resolve it. It calls list_feedback, reads each report with its screenshot through get_feedback, and finds the code. An element name such as checkout.pay_button leads straight to the line that says .nitpickElement("checkout.pay_button"), and a screen name leads to the matching .nitpickScreen call. When the fix is done it calls resolve_feedback.
Working with Claude Code
claude "task"starts a session with a first prompt already filled in, so you can pass the start prompt on the command line.claude -ccontinues the most recent conversation in the folder, which helps when you return to fix the next report.claude -p "query"answers one question and exits, for example how many reports are open.
Good to know for SwiftUI
- The tab and panel live in their own windows above your app, so they also show over sheets and full screen covers.
- Password fields are covered in the screenshot where iOS allows it. Everything else sensitive needs .nitpickMask().
$9 a month per account. Unlimited apps.
Get startedRelated
- Claude Code with Expo
- Codex with SwiftUI
- Cursor with SwiftUI
- Gemini CLI with SwiftUI
- Add in-app feedback to a SwiftUI app
- In-app feedback with a screenshot in SwiftUI
- Collect bug reports from users in SwiftUI
- MCP reference