Get AI summaries of any video or article — Sign up free
How to Build an App From Scratch With AI(Zero Coding) thumbnail

How to Build an App From Scratch With AI(Zero Coding)

Prakash Joshi Pax·
5 min read

Based on Prakash Joshi Pax's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Create a minimal working SwiftUI Mac app in Xcode first, then use Cursor Composer to generate code from plain-language requirements.

Briefing

A practical workflow for building a Mac app from scratch with AI—starting with a minimal, working version and then iterating through prompts—anchors the process. The creator demonstrates this by generating a SwiftUI timer app in Cursor (a VS Code fork with AI features), then repeatedly refining it based on build errors and missing behaviors until it reliably plays an alarm sound and keeps the timer window in front when the countdown ends.

The build starts with a clean Xcode project for a “Mac timer” app, then links that project folder to Cursor. In Cursor’s Composer, the user selects the relevant SwiftUI files (or creates them if needed) and provides a plain-language spec: a modern-looking Mac timer with a default option (customizable in seconds), a stop control, and alarm-like behavior that repeatedly plays a sound until the user stops it—even if the window is minimized or hidden. Cursor generates and edits multiple files, including a new “timer manager” Swift file, and the app is previewed in Xcode.

When SwiftUI errors appear, the workflow treats them as feedback loops rather than blockers. The user copies the compiler error text back into Composer, prompting Cursor to correct platform-specific issues (for example, code that referenced iPhone-only keyboard types). After accepting Cursor’s changes, the app builds successfully. From there, refinement continues: the initial timer only offers a single 5-minute option and lacks polished UI spacing, so new prompts request additional default durations (5, 10, 20 minutes), improved button layout, and audio playback. Cursor adds an MP3 asset (renamed to “alarm.mp3”) and injects audio-player logic so the sound plays repeatedly when the timer finishes.

The same pattern repeats for UI/UX tweaks: if the buttons look wrong or the alarm behavior doesn’t match expectations, the user prompts Cursor to “remove and fix” the issue, rebuilds, and verifies behavior. The result is a functional timer app with default and custom durations, a stop button, and an alarm that continues until stopped, with the timer window brought to the front at completion.

To show the approach scales beyond a toy example, the workflow is applied to “Gen Focus,” a productivity app. Cursor is used to implement a keyboard-navigation feature for task categories: auto-select the first category, provide visual feedback, allow navigation with arrow keys, and select with Return. Cursor edits the category picker and task list view components, but when navigation fails or new SwiftUI errors appear (e.g., missing types), the user cycles through error-copying prompts. The process ends with a working build, and the creator emphasizes a key safeguard: once a version works, save/copy it elsewhere because AI changes can later introduce new breakage.

Overall, the core insight is that coding knowledge isn’t the prerequisite; clear requirements, iterative prompting, and disciplined error-driven correction are. Cursor’s Composer becomes the control center—generate, accept changes, compile, copy errors back, and either keep the fix or discard it and try another approach—until the app behaves exactly as intended.

Cornell Notes

The workflow centers on building a minimal SwiftUI Mac app in Xcode, then using Cursor’s Composer to generate and iteratively improve code from plain-language prompts. After each generation, Xcode compile errors are copied back into Cursor to fix platform-specific or SwiftUI issues, such as iPhone-only APIs used in Mac code. The timer app evolves from a basic countdown into a polished version with multiple default durations, a custom seconds option, repeated alarm playback using an added “alarm.mp3,” and behavior that brings the window to the front when time expires. The same loop is applied to Gen Focus, where Cursor implements keyboard navigation for categories, with additional error-fixing cycles when SwiftUI focus or missing-type errors appear.

How does the workflow turn a plain-language app idea into working SwiftUI code on macOS?

It starts by creating a new Xcode project for the Mac app, then opening that project folder in Cursor. In Cursor’s Composer, the user selects the relevant SwiftUI files (or adds files if the folder is empty) and provides a detailed prompt describing required behavior—UI options, stop controls, and alarm behavior. Cursor then edits existing files and generates new ones (e.g., a timer manager Swift file), after which the app is built and previewed in Xcode.

What’s the role of compiler errors in the process?

Compiler errors act like a debugging checklist. When SwiftUI code fails to compile, the user copies the exact error messages and pastes them back into Composer. Cursor responds by adjusting the code to match macOS expectations—for example, replacing iPhone-only keyboard type usage with macOS-compatible logic—until the project builds successfully.

How does the timer app achieve “alarm-like” repeated sound until the user stops it?

Cursor adds audio playback logic and an MP3 asset. The workflow includes adding a file named “alarm.mp3” into the project (renaming an existing MP3 asset to match). The app then plays the sound repeatedly when the timer finishes, and the loop stops only when the user presses the stop button.

How are UI and UX issues handled after the app already builds?

Once the app compiles, prompts focus on behavior and presentation. For example, the user requests more default timer options (5, 10, 20 minutes), fixes button spacing, and improves button appearance. Cursor updates the ContentView and related UI code, and the user verifies the changes by rebuilding and testing interactions like minimizing the window and confirming it reappears when the timer ends.

How does the workflow scale to a more complex productivity feature in Gen Focus?

The same generate–accept–build–fix loop is used. Cursor is prompted to auto-select the first category by default, show visual feedback, and enable keyboard navigation (arrow keys to move categories, Return to select). Cursor edits the category picker and task list view components, and when focus/navigation doesn’t work or new SwiftUI errors appear, those errors are copied back into Composer for further correction.

What safeguard helps prevent losing progress when AI changes break working code?

After reaching a working version, the workflow recommends copying/saving that code elsewhere. The creator notes that later AI iterations can introduce many new errors, so having a known-good snapshot makes it easier to revert and re-apply fixes rather than starting from a broken state.

Review Questions

  1. When Cursor generates code that compiles on one platform but fails on macOS, what specific step in the workflow is used to correct it?
  2. Describe how the timer app’s repeated alarm behavior is implemented and how the stop action changes that behavior.
  3. In Gen Focus, what keyboard interactions are targeted for category selection, and which UI components are modified to support them?

Key Points

  1. 1

    Create a minimal working SwiftUI Mac app in Xcode first, then use Cursor Composer to generate code from plain-language requirements.

  2. 2

    Use Cursor Composer with selected SwiftUI files so the AI has context across multiple files and can edit them coherently.

  3. 3

    Treat Xcode compiler errors as actionable prompts: copy the exact error text back into Composer to drive targeted fixes.

  4. 4

    Iterate on features in layers—start with core functionality, then add default options, UI polish, and audio behavior once the app builds.

  5. 5

    For alarm behavior, add an MP3 asset (renamed to “alarm.mp3”) and implement repeated playback that stops only when the user presses Stop.

  6. 6

    When adding UX features like keyboard navigation, verify focus behavior in the running app; if it fails, prompt Cursor again and resolve new SwiftUI errors.

  7. 7

    Save a known-good version of the code after it works, because later AI edits can introduce new breakage.

Highlights

Cursor’s Composer can generate and modify multiple SwiftUI files at once when the project folder is opened and relevant files are included.
Copying compiler error messages back into Composer is the main debugging mechanism used to resolve macOS-specific SwiftUI issues.
The timer’s “alarm” behavior relies on repeatedly playing an added “alarm.mp3” until the user stops it.
A key workflow rule is to keep a working snapshot of the code, since subsequent AI iterations can create new errors.
Gen Focus keyboard navigation is implemented by editing the category picker and task list view to manage focus and Return/arrow-key interactions.

Topics

  • Cursor Composer Workflow
  • SwiftUI Timer App
  • macOS Xcode Project Setup
  • Iterative AI Debugging
  • SwiftUI Keyboard Navigation

Mentioned