Cursor Rules for Native iOS Layout: A Free .cursorrules
Cursor follows whatever rules you give it, and most people give it none. A native-iOS .cursorrules file is the cheapest quality upgrade you can make.
TL;DR
Cursor generates better native iOS UI when you give it a .cursorrules file that pins the conventions: SwiftUI over UIKit unless asked, system fonts and semantic colors, an 8-point spacing scale, native navigation and controls, and no web idioms. Pair the rules with a free VP0 design reference for the visual target. The rules anchor correctness; the reference anchors design. Set it once, reuse it everywhere.
Tired of Cursor turning out web-flavored iOS UI? The short answer: Cursor follows the rules you give it, and most people give it none. A native-iOS .cursorrules file is the cheapest quality upgrade available. Pair it with a free VP0 design, the free iOS design library for AI builders, for the visual target, and Cursor produces idiomatic SwiftUI instead of a website in a phone frame. Rules anchor correctness; the reference anchors design. about 76% of developers now use or plan to use AI tools in their workonsider the scale: C.
Who this is for
This is for developers using Cursor to build iOS apps who keep correcting the same non-native patterns, and want to encode their conventions once so every generation starts right.
What a native-iOS .cursorrules should pin
A good rules file removes ambiguity. Prefer SwiftUI unless UIKit is explicitly needed. Use the system font and semantic colors, never hard-coded hex, so dark mode and Dynamic Type work for free. Use an 8-point spacing scale. Reach for native navigation and controls, NavigationStack, tab bars, the standard pickers, instead of reinventing them. And forbid web idioms outright. The Cursor documentation covers rules files, SwiftUI is the target framework, and the Apple Human Interface Guidelines define the conventions.
| Rule area | What to pin | Why |
|---|---|---|
| Framework | SwiftUI by default | Native, modern |
| Type and color | System font, semantic colors | Dark mode, Dynamic Type |
| Spacing | 8-point scale | Consistent rhythm |
| Navigation | NavigationStack, tab bars | Real iOS patterns |
| Forbidden | Web idioms, hard-coded hex | Stops web drift |
Build it free with a VP0 design
Rules fix conventions; a reference fixes the look. Keep your .cursorrules in the project, then point Cursor at a VP0 screen:
Following the project .cursorrules, build this screen to match the VP0 design at [paste VP0 link]. Use SwiftUI, system fonts, semantic colors, and the 8-point spacing scale, and match the layout and components from the reference.
For related Cursor and prompting workflows, see Cursor rules for a SwiftUI native mobile template, prompting Claude for strict iOS spacing with tokens, AI-ready Swift mappings boilerplate, and how to make an AI app look native on iOS.
Keep the rules tight and growing
A rules file works because it is concise and authoritative, so keep it to the conventions that matter and add a line whenever Cursor gets one wrong. Over a few sessions it becomes a record of your project’s standards, and new screens inherit them automatically. Reuse the same file across the project so screen two matches screen one. The combination of a tight rules file and a VP0 reference is what turns Cursor from a fast-but-generic generator into one that ships native screens you do not have to re-style.
Common mistakes
The first mistake is no rules file, so Cursor drifts web. The second is a bloated file it ignores; keep it tight. The third is rules without a visual reference, so it is correct but plain. The fourth is letting the file go stale as your conventions evolve. The fifth is not reusing it across screens, so consistency slips.
Key takeaways
- Cursor follows your rules; a native-iOS .cursorrules is the cheapest quality win.
- Pin SwiftUI, system fonts, semantic colors, an 8-point scale, and native navigation.
- Forbid web idioms explicitly to stop web drift.
- Pair the rules with a free VP0 reference for the visual target.
- Keep the file tight and grow it as Cursor gets things wrong.
Frequently asked questions
What should a .cursorrules file for native iOS contain? Prefer SwiftUI, use system fonts and semantic colors, an 8-point spacing scale, native navigation and controls, and no web idioms. Set it once and Cursor follows it.
What is the best free way to get native iOS UI from Cursor? Pair a native-iOS .cursorrules file with a free VP0 design reference: rules anchor correctness, VP0 anchors the look.
Why does Cursor generate web-flavored iOS code? Without rules it leans on common web patterns. A rules file that forbids web idioms and requires native conventions redirects it.
Do .cursorrules work for React Native too? Yes. Pin your conventions, component patterns, and styling once so output stays consistent; the technique is identical.
Frequently asked questions
What should a .cursorrules file for native iOS contain?
Pin the conventions: prefer SwiftUI, use system fonts and semantic colors, an 8-point spacing scale, native navigation and controls, and no web idioms like div-style nesting or hard-coded hex. Add the rules once and Cursor follows them on every generation.
What is the best free way to get native iOS UI from Cursor?
Pair a native-iOS .cursorrules file with a free VP0 design reference. The rules anchor correctness and conventions, and VP0, the free iOS design library for AI builders, gives Cursor the visual target so the output is both native and polished.
Why does Cursor generate web-flavored iOS code?
Without rules it leans on the most common patterns it has seen, which skew web. A .cursorrules file that explicitly forbids web idioms and requires native conventions redirects it to idiomatic SwiftUI.
Do .cursorrules work for React Native too?
Yes. The same idea applies: pin your conventions, component patterns, and styling approach in the rules so output is consistent. The specifics differ, but the technique of encoding conventions once is identical.
Part of the Free iOS Templates, UI Kits & Components hub. Browse all VP0 topics →
Keep reading
Cursor Mobile Workflow: Start From Templates, Not Prompts
Pure prompting in Cursor for mobile is slow and inconsistent. A starter-template workflow gets you native screens faster. Here is the template-first approach.
Prompt Claude for Strict iOS Spacing With Tokens
AI-built iOS screens with messy margins? Force strict spacing by giving Claude a token scale, an 8-point grid as variables or constants, so layout stays consistent.
Cursor AI Android to iOS Conversion: How to Do It Right
Converting an Android app to iOS with Cursor AI? It is a translation, not a copy. Here is how to map Material to native iOS and avoid an Android-looking app.
How to Build an iOS App With Cursor (Free Start)
How to make an iOS app with Cursor: set up the project, give it native rules and a free design reference, and build screen by screen to a real app.
AI-Ready Swift Mappings: A Free SwiftUI Boilerplate
Give your AI builder a SwiftUI mapping kit, a cheat sheet of UI concept to SwiftUI API, so Claude or Cursor generates correct native code instead of guessing.
AI Companion App Template for iOS, Free
Build an AI companion app for iOS from a free template. Get the chat, persona, and memory UI with Claude Code or Cursor, then connect your model.