Easy PromptAI Prompt Library
CodingCodeAdvanced

SwiftUI Code Reviewer

Comprehensively reviews SwiftUI code for best practices on modern APIs, maintainability, performance, accessibility, and design compliance with actionable fixes.

Prompt Content

Copy and paste directly into your model or internal evaluation tool.

Review Swift and SwiftUI code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.

Review process:

  1. Check for deprecated API.
  2. Check that views, modifiers, and animations have been written optimally.
  3. Validate that data flow is configured correctly.
  4. Ensure navigation is updated and performant.
  5. Ensure the code uses designs that are accessible and compliant with Apple's Human Interface Guidelines.
  6. Validate accessibility compliance including Dynamic Type, VoiceOver, and Reduce Motion.
  7. Ensure the code is able to run efficiently.
  8. Quick validation of Swift code.
  9. Final code hygiene check.

If doing a partial review, load only the relevant sections below.

Core Instructions

  • iOS 26 exists, and is the default deployment target for new apps.
  • Target Swift 6.2 or later, using modern Swift concurrency.
  • As a SwiftUI developer, the user will want to avoid UIKit unless requested.
  • Do not introduce third-party frameworks without asking first.
  • Break different types up into different Swift files rather than placing multiple structs, classes, or enums into a single file.
  • Use a consistent project structure, with folder layout determined by app features.

Output Format

Organize findings by file. For each issue:

  1. State the file and relevant line(s).
  2. Name the rule being violated (e.g., "Use foregroundStyle() instead of foregroundColor()").
  3. Show a brief before/after code fix.

Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.

Example output:

ContentView.swift

Line 12: Use foregroundStyle() instead of foregroundColor().

// Before
Text("Hello").foregroundColor(.red)

// After
Text("Hello").foregroundStyle(.red)

Line 24: Icon-only button is bad for VoiceOver - add a text label.

// Before
Button(action: addUser) {
    Image(systemName: "plus")
}

// After
Button("Add User", systemImage: "plus", action: addUser)

Line 31: Avoid Binding(get:set:) in view body - use @State with onChange() instead.

// Before
TextField("Username", text: Binding(
    get: { model.username },
    set: { model.username = $0; model.save() }
))

// After
TextField("Username", text: $model.username)
    .onChange(of: model.username) {
        model.save()
    }

Summary

  1. Accessibility (high): The add button on line 24 is invisible to VoiceOver.
  2. Deprecated API (medium): foregroundColor() on line 12 should be foregroundStyle().
  3. Data flow (medium): The manual binding on line 31 is fragile and harder to maintain.

End of example.

Use Cases

Review SwiftUI project code qualityIdentify and fix deprecated API usageImprove accessibility complianceOptimize data flow and state managementEnsure navigation and animations follow best practicesStandardize code style and project structure

Reference Output

### ContentView.swift **Line 12: Use `foregroundStyle()` instead of `foregroundColor()`.** ```swift // Before Text("Hello").foregroundColor(.red) // After Text("Hello").foregroundStyle(.red) ``` **Line 24: Icon-only button is bad for VoiceOver - add a text label.** ```swift // Before Button(action: addUser) { Image(systemName: "plus") } // After Button("Add User", systemImage: "plus", action: addUser) ``` ### Summary 1. **Accessibility (high):** The add button on line 24 is invisible to VoiceOver. 2. **Deprecated API (medium):** `foregroundColor()` on line 12 should be `foregroundStyle()`.

Scoring Rubric

Scoring Rubric: - **Completeness (30%):** Coverage of all review dimensions (API, accessibility, performance, design) - **Accuracy (30%):** Correctness of issue identification and adherence to SwiftUI best practices - **Actionability (20%):** Specificity and implementability of fixes with before/after examples - **Prioritization (20%):** Logical ranking of issue impact (high/medium/low)

User Rating

0 ratings
-

Your rating

Log in to rate

Comments

0

Log in to comment

Related Prompts

ImageWriting

Product Marketing - Monochrome Avant-Garde Fashion Portrait

A high-fashion, monochrome editorial prompt for a sharp portrait with dramatic lighting and futuristic accessories, mimicking a luxury brand campaign.

Nano Banana Proimage promptProduct Marketing
Nano Banana Pro image generation
ImageWriting

Social Media Post - Dreamy Woman in Wildflower Field

A cinematic, photorealistic prompt for a serene portrait of a woman in a field of daisies, emphasizing soft natural light and sharp focus on foreground details.

Nano Banana Proimage promptSocial Media Post
Nano Banana Pro image generation
ImageWriting

Social Media Post - Mediterranean Riviera Male Menswear

A comprehensive professional photography prompt for a sharp, high-contrast menswear editorial set against sun-drenched stone architecture.

Nano Banana Proimage promptSocial Media Post
Nano Banana Pro image generation