iOS SwiftUI App Builder with MVVM
mobile
Swift
architecture
strict_senior
Build a modern iOS app using SwiftUI with MVVM architecture, Combine, and async/await for custom features.
By emily_r
12/8/2025
Prompt
Build an iOS app using SwiftUI and MVVM architecture for the following requirements:
App Overview
- App Name: [e.g., TaskMaster, PhotoGallery, FitnessTracker]
- App Purpose: [What does this app do?]
- Target iOS Version: [iOS 16+ / iOS 17+ / iOS 15+]
- iPad Support: [Yes / iPhone only]
Core Features
Define 4-6 main features/screens:
Feature 1: [Feature Name]
- Screen Type: [List view / Detail view / Form / Tab / Custom]
- Data Source: [API / Local storage / Core Data / SwiftData / Static]
- User Interactions: [Tap, swipe, pull-to-refresh, search, filter, etc.]
- Navigation: [Push / Modal / Tab / Sheet]
Feature 2: [Feature Name]
- Screen Type: [List view / Detail view / Form / Tab / Custom]
- Data Source: [API / Local storage / Core Data / SwiftData / Static]
- User Interactions: [List interactions]
- Navigation: [Navigation type]
[Continue for 4-6 features]
Data Models
Define your main data models:
Model 1: [Name]
- Properties: [List properties with types: id: UUID, name: String, etc.]
- Identifiable: [Yes / No]
- Codable: [Yes / No]
- Relationships: [Related to other models if any]
Model 2: [Name]
- Properties: [List properties with types]
- Identifiable: [Yes / No]
- Codable: [Yes / No]
- Relationships: [Related to other models if any]
Network Layer
- API Base URL: [Provide URL or placeholder: https://api.example.com]
- Authentication: [Bearer token / API key / OAuth / None]
- API Endpoints: [List endpoints: GET /users, POST /items, etc.]
- Response Format: [JSON / XML / Custom]
- Error Handling: [Custom error types / Standard / Simple]
State Management
- View Models: [One per feature / Shared / Custom approach]
- Published Properties: [List key @Published properties for each ViewModel]
- Async Operations: [async/await / Combine / Both]
- State Persistence: [UserDefaults / Keychain / Core Data / SwiftData / None]
UI/UX Requirements
- Navigation Pattern: [NavigationStack / TabView / SplitView / Custom]
- Color Scheme: [Light/Dark mode support / Light only / Dark only]
- Custom Theme: [Yes with colors: [LIST] / System default]
- Loading States: [ProgressView / Custom loader / Skeleton screens]
- Error Handling UI: [Alert / Custom error view / Toast / Banner]
- Empty States: [Custom views / Standard messages]
Architecture Details
- MVVM Implementation: [Strict separation / Flexible / Custom]
- Dependency Injection: [Protocol-based / Simple / None]
- Service Layer: [Separate services (API, Storage, etc.) / Combined / None]
- Actor Usage: [For thread safety in services / Not needed]
Data Persistence
- Storage Mechanism: [Core Data / SwiftData / UserDefaults / Keychain / None]
- Cached Data: [Yes for: [SPECIFY] / No caching]
- Offline Support: [Full offline mode / Read-only / Not needed]
Additional Features
- Search: [Required with scope: [SPECIFY] / Not needed]
- Filtering/Sorting: [Yes with options: [LIST] / No]
- Pull-to-Refresh: [Yes / No]
- Pagination: [Required / Not needed]
- Image Loading: [URLSession / AsyncImage / Third-party / Not needed]
- Notifications: [Local / Push / Both / None]
- Deep Linking: [Required / Not needed]
Project Structure
- Folder Organization: [Feature-based / Layer-based (Models, Views, ViewModels) / Custom]
- File Naming: [Descriptive / Conventional / Custom]
Code Style Preferences
- Property Wrappers: [@StateObject, @ObservedObject, @EnvironmentObject / Custom usage]
- View Composition: [Small reusable views / Larger views / Balanced]
- Extension Usage: [Extensive / Minimal / Moderate]
Generate a complete iOS SwiftUI app with:
- Full project structure with organized folders
- All data models with proper protocols (Identifiable, Codable)
- ViewModels with @Published properties and async methods
- SwiftUI views with proper state management
- API service layer with async/await (if API is needed)
- Navigation setup (NavigationStack, TabView, etc.)
- Loading, error, and empty state handling
- Reusable components and utilities
- Example of proper MVVM pattern implementation
Output production-ready Swift code following iOS best practices with proper error handling, thread safety using actors, and modern SwiftUI patterns.
Tags
ios
swiftui
mvvm
combine
Tested Models
gpt-4
claude-3-opus