Skip to content

Cline + SwiftUI

In-app feedback for SwiftUI, fixed by Cline

You are building a SwiftUI app with Cline. Cline lives in a panel inside VS Code and asks before it acts, so you watch each step. Its MCP settings are one JSON file that you open from the panel.

1. Paste one prompt into Cline

Open your project in VS Code, open the Cline panel, and paste the prompt into its chat.

Add Nitpick feedback to this app. Fetch https://nitpickhq.com/install.md and follow every step.

Cline follows install.md. nitpick login opens your browser, where you create an account and start the subscription, and Cline waits for that before it adds the component.

The model marks each command as safe or as needing approval. Under Auto Approve you choose whether Cline runs only the commands marked safe, or all commands, without asking, and a separate setting covers MCP servers.

2. What lands in your SwiftUI code

Roughly this. Cline writes it, you review it.

  1. Add the Swift package in Xcode with File > Add Package Dependencies, and put the Nitpick product in your app target.
  2. Check that the deployment target is iOS 17.0 or newer.
  3. Call Nitpick.configure once at launch, then name screens and elements.
App.swift
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 Cline the MCP server

Cline keeps MCP servers in a settings file that you open from its own panel: the MCP Servers icon, then the Configure tab, then Configure MCP Servers.

MCP settings (opened from the Cline panel)
{
  "mcpServers": {
    "nitpick": {
      "command": "npx",
      "args": ["-y", "@nitpickhq/cli", "mcp"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Leave autoApprove empty until you have seen what the tools do. You can allow single tools later, such as list_feedback.

Open the MCP Servers icon again. The nitpick entry should be listed there and enabled.

4. Build and run in the simulator with Cline

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.

terminal
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.myapp

Build and simulator commands usually show up as commands that need approval. Keep them manual for the first run, then switch on the safe-command setting if you want fewer clicks.

5. Let Cline fix the reports

In the Cline chat, ask it to use the Nitpick MCP tools: list open feedback, fix each report and mark it resolved. 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 Cline

Good to know for SwiftUI

$9 a month per account. Unlimited apps.

Get started

Related

Sources