Prompts for Swift and iOS: SwiftUI, UIKit, Core Data, and Combine — How We Doubled Development Speed

Introduction

Hello! We are a team of mobile developers, and in July 2026 we faced a task: to build an MVP of a finance app for iOS in 4 weeks. Deadlines were tight, and the functionality required serious work: SwiftUI screens, a complex UIKit module for analytics, data storage on Core Data, and reactive updates via Combine.

We decided to try an unconventional approach — actively using AI prompts for code generation and review. In this article, we share a cheat sheet of 20+ specific prompts that genuinely saved us dozens of hours. All examples are from our real project, and the prompts can be copied and adapted to your own tasks.

The problem: too much code in too little time

The starting point: the app had to include:

  • A SwiftUI login and registration screen with field validation.
  • A dashboard with charts on UIKit (we didn't rewrite the legacy module).
  • A budget with expense categories stored in Core Data.
  • Automatic UI updates when a new transaction is added via Combine.

Writing all this by hand — at least 2,000 lines of code. Plus we had to follow architecture (MVVM) and consider iOS 17 and 18 best practices. We realized there was no way around "smart" hints.

Solution: a set of battle-tested prompts for iOS

We grouped prompts by key areas. Each prompt is a precise instruction for a neural network (ChatGPT or similar). It's important to give prompts in a conversation where you've already set the context (for example, "You are a senior iOS developer"). Below is what actually worked.

SwiftUI prompts

Task: quickly create a login screen with validation.

Problem: we needed clean code with @FocusState and @StateObject so we wouldn't have to rework it later.

Prompt:

You are a senior SwiftUI developer. Generate code for a login screen for an iOS app.
Requirements:
- Fields: email (with email keyboard), password (SecureField).
- Validation: email via regex, password at least 8 characters.
- Use @FocusState to switch between fields and @StateObject for the model.
- The "Sign In" button is disabled until validation passes.
- Code must be ready to embed in MVVM.
- Add comments in Russian.

Result: we got neat code ~120 lines long with no errors. The prompt worked on the first try. We even used it on two other screens (registration and password recovery), adapting it to our needs.

Second SwiftUI prompt — navigation and lists:

Create a SwiftUI structure for a list of transactions with NavigationStack.
- Use Transaction model (id, amount, date, categoryName).
- Each cell is a NavigationLink that opens a detail screen.
- Pass data via value-based navigation.
- Add a toolbar with a "+" button for a new transaction.
- SwiftUI 5 (iOS 17+).

This prompt helped us quickly organize screen transitions without unnecessary wrappers.

UIKit prompts

Task: build an analytics dashboard with a collection of charts.

Prompt:

You are an iOS developer. Write UIKit code for a dashboard screen.
- Use UICollectionView with CompositionalLayout: a 2×2 grid section and a section with horizontal scrolling.
- Cells: a container with a title and a chart (UIView placeholder).
- Data comes from an array.
- Support Dark Mode, use system colors.
- Code should be in MVVM style.

Result: the generated code created the required structure, but the cells had extra elements. After clarifying "keep it short and only cells with titles" we got what we needed. In total, this saved about 3 hours.

One more useful UIKit prompt — refactoring:

Show how to rewrite this Swift method (attach code) using UITableViewDiffableDataSource delegate. Add empty-state handling.

These prompts are handy in conversation: you paste a code fragment and get an improved version.

Core Data prompts

Task: design a data model for a budget and write queries.

Prompt:

You are a Core Data expert. Design a model for a "Budget" app.
Requirements:
- Entities: Transaction, Category.
- Transaction: amount (Decimal), date (Date), note (String?)
- Category: name (String), icon (String?)
- Relationship: category has many transactions (cascade delete).
- Provide code for creating the model and NSPersistentContainer.
- Explain how to enable migrations.

Result: we got a ready-made model and code for the persistent container. No errors on launch. The only thing we added was a UUID attribute for synchronization.

Second Core Data prompt — queries with NSFetchedResultsController:

Write Swift code to fetch transactions for the current month, sorted by date.
- Use NSFetchedResultsController.
- Handle changes through the delegate.
- Update UITableView or UICollectionView.
- Wrap in a repository class.

This prompt worked perfectly for our UIKit module. For the SwiftUI version, we used a similar query via @FetchRequest wrapped around NSManagedObject.

Combine prompts

Task: bind input data to the login button and update the UI when transactions change.

Prompt:

You are a Combine expert. Write code that combines two TextFields (email, password) using combineLatest and enables the button only if both are non-empty and the email is valid.
- Use @Published in the model.
- Store subscriptions in an AnyCancellable set.
- Code must target iOS 17.

Result: correct code that we used for the login screen. Later, we adapted it for form validation in SwiftUI by adding the debounce operator.

Second prompt — reactive updates via NotificationCenter + Combine:

Create a publisher that listens to Notification.Name("transactionDidChange") and updates the total expense amount on the dashboard.
- Use sink to receive the notification.
- Then call a network request (or fetch from Core Data).
- Handle unsubscription in deinit.

This prompt came in handy for syncing data between Core Data and UI.

Results: what changed after using the prompts

We measured the time to write a typical "login" screen and "transaction history". Here's what we got:

Task Without prompts (h) With prompts (h) Savings
SwiftUI login screen 6 2.5 58%
Navigation and transaction list 8 4 50%
UIKit dashboard (collection) 16 9 44%
Core Data model and repository 12 5 58%
Combine bindings 7 3 57%

In the end, we met the deadline and saved about 40 hours for a team of 3 people. The prompts not only sped up code writing but also reduced the number of errors — the neural network knows syntax and typical patterns well.

Conclusions and tips

  1. Prompts are not a replacement for a developer, but a tool. They are great at generating templates, but you still need to understand the architecture and business logic.
  2. Context matters more than the prompt. At the start of the conversation, set a role: "You are a senior iOS developer with SwiftUI experience" — the answer quality improves immediately.
  3. Refine your requirements. If the code isn't ideal, don't be afraid to give feedback: "Use less nesting", "Add error handling", "Rewrite with async/await".
  4. Review code. AI sometimes uses outdated APIs (for example, @EnvironmentObject instead of @Observable). In 2026, you should definitely use @Observable and SwiftData, but we had legacy Core Data.

Conclusion

Prompts for Swift and iOS are a powerful tool that helped us handle tight deadlines without burning out. We've shared only a small part of what we actually use at work. If you also want to speed up development of your apps — start with these prompts today.

And if you want more ready-made iOS solutions, subscribe to our blog asibiont.com/blog — we regularly publish breakdowns, prompts, and case studies. Like and share with anyone who writes in Swift. Good luck with your development!

← All posts

Comments