
App Planner
- 2 installs
- 591 repo stars
- Updated July 24, 2026
- rshankras/claude-code-apple-skills
Guides comprehensive iOS/Swift app planning for new apps or audits of existing ones, covering product, technical stack, UI/UX, and distribution decisions.
About
Walks through planning a new iOS/Swift app from concept to architecture or auditing an existing app's state and tech stack. A developer uses it to define features, requirements, and a distribution strategy or to evaluate an app for improvement.
- Separate flows for new-app planning and existing-app audits
- Covers product, technical, UI/UX, and distribution considerations
App Planner by the numbers
- 2 all-time installs (skills.sh)
- Ranked #2,412 of 3,282 Productivity & Planning skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/rshankras/claude-code-apple-skills --skill app-plannerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2 |
|---|---|
| repo stars | ★ 591 |
| Last updated | July 24, 2026 |
| Repository | rshankras/claude-code-apple-skills ↗ |
What it does
Guides comprehensive iOS/Swift app planning for new apps or audits of existing ones, covering product, technical stack, UI/UX, and distribution decisions.
Files
App Planner Skill
Comprehensive guide for planning iOS/Swift applications and analyzing existing apps, covering product, technical, UI/UX, and distribution considerations.
When This Skill Activates
Use this skill when the user:
For New Apps:
- Wants to plan a new iOS/Swift app from scratch
- Asks about app planning, architecture planning, or project setup
- Needs help defining features, requirements, or technical stack
- Wants to create a comprehensive app plan or design document
- Asks "what should I consider when building a new app?"
For Existing Apps:
- Wants to analyze or audit their current iOS app
- Asks to "run through my existing app"
- Needs architecture evaluation or recommendations
- Wants tech stack assessment
- Planning major refactoring or improvements
- Evaluating app health and identifying gaps
Planning Process
1. Understand Project Context
First, determine if this is a new app or existing app, then gather context:
App Status:
- New app (planning from scratch)
- Existing app (analyze/improve)
For NEW Apps - gather:
- Project Type: Personal, client, startup, learning
- Current Stage: Just an idea, have requirements, have designs, technical only
- Scope: Full planning, feature planning, architecture only, tech stack only
For EXISTING Apps - gather:
- Project Type: Personal, client, startup, enterprise
- App Age: How long in development/production
- Codebase Size: Small (<10 screens), medium (10-30), large (30+)
- Current Issues: Performance, maintainability, feature additions, technical debt
- Analysis Scope: Full audit, architecture review, tech stack evaluation, specific area
- Existing Tech Stack: SwiftUI/UIKit, architecture pattern, persistence layer
- Pain Points: What's not working well, what needs improvement
Then proceed to appropriate workflow:
- New App → Continue to "Planning Phases for New Apps" (Section 3)
- Existing App → Jump to "Analysis Process for Existing Apps" (Section 6)
2. Load Reference Materials
Before detailed planning, familiarize yourself with these references in .claude/skills/app-planner/:
- planning-checklist.md - Comprehensive planning checklist covering all phases
- architecture-guide.md - Architecture patterns, decisions, and trade-offs
- tech-stack-options.md - Technology choices for different requirements
3. Planning Phases for New Apps
Note: For existing apps, skip to Section 6 "Analysis Process for Existing Apps"
Guide the user through these planning phases based on their scope:
Phase 1: Product Planning
Goals:
- Define what the app does and who it's for
- Identify core features and prioritization
- Understand user needs and workflows
Activities: 1. Define App Purpose
- What problem does it solve?
- What's the core value proposition?
- What makes it different?
2. Identify Target Users
- Who will use this app?
- What are their goals and pain points?
- Create 1-2 user personas if helpful
3. Feature Definition
- List all potential features
- Categorize: MVP (must-have), v2 (nice-to-have), future
- Prioritize based on value and complexity
4. User Journeys
- Map key user workflows
- Identify main user paths through the app
- Note critical touchpoints
Phase 2: Technical Planning
Goals:
- Choose appropriate architecture and patterns
- Design data models
- Select technology stack
- Plan project structure
Activities: 1. Architecture Selection
- Review architecture-guide.md for options (MVVM, TCA, etc.)
- Consider project size, team experience, requirements
- Ask user about preferences and constraints
- Recommend architecture with rationale
2. Data Modeling
- Identify main entities and relationships
- Define data flow (where data comes from, where it goes)
- Choose persistence layer:
- Core Data (complex data, relationships, offline-first)
- SwiftData (iOS 17+, modern alternative)
- UserDefaults (simple settings only)
- Realm (alternative to Core Data)
- Custom backend + caching
3. Tech Stack Decisions
- Review tech-stack-options.md for guidance
- UI Framework: SwiftUI, UIKit, or hybrid
- Minimum iOS version: Based on features needed
- Networking: URLSession, Alamofire, or custom
- Dependencies: SPM, CocoaPods, or manual
- Third-party libraries: Based on requirements
- Ask about user preferences and constraints
4. Project Structure
- Folder organization (features, layers, modules)
- Modularization strategy (monolith vs multi-module)
- Code organization patterns
Phase 3: UI/UX Planning
Goals:
- Plan user interface and experience
- Ensure HIG compliance
- Design navigation and flows
Activities: 1. Design System
- Color palette (consider dark mode)
- Typography (SF Pro, custom fonts)
- Spacing system (8pt grid recommended)
- Component library planning
2. Navigation Pattern
- Tab bar (2-5 main sections)
- Sidebar (iPad, complex hierarchies)
- Navigation stack (linear flows)
- Sheet/modal presentations
- Recommend based on app structure
3. Screen Planning
- List all main screens
- Create simple wireframes or descriptions
- Define screen hierarchy
- Plan empty states, loading states, error states
4. Accessibility First
- Dynamic Type support
- VoiceOver compatibility
- Color contrast requirements
- Accessibility features priority
5. Onboarding & UX Flows
- First-time user experience
- Key user flows
- Error handling UX
- Feedback mechanisms
Phase 4: Non-Functional Requirements
Goals:
- Define performance, security, testing requirements
- Plan for scalability and maintainability
Activities: 1. Performance Targets
- Target device range (iPhone only, iPad support, Mac Catalyst)
- Performance benchmarks
- Memory constraints
- Battery usage considerations
2. Security & Privacy
- Authentication needs (if any)
- Data encryption requirements
- Privacy policy requirements
- Secure storage for sensitive data
- App Transport Security compliance
3. Testing Strategy
- Unit testing approach and coverage goals
- UI testing requirements
- Beta testing plan
- QA process
4. Monitoring & Analytics
- Analytics needs (user behavior tracking)
- Crash reporting (essential for production apps)
- Performance monitoring
- User feedback mechanism
Phase 5: Distribution & Business
Goals:
- Plan for App Store distribution
- Define monetization (if applicable)
- Set timeline and milestones
Activities: 1. App Store Planning
- App name availability check
- Bundle identifier decision
- Screenshots/preview planning
- App description and keywords
2. Monetization (if applicable)
- Free, paid, freemium, subscription
- In-app purchases planning
- Ad integration strategy
3. Localization
- Initial language(s)
- Internationalization strategy
- Future localization plans
4. Timeline & Milestones
- MVP timeline estimate
- Feature milestones
- Release schedule
- Version planning (1.0, 1.1, 2.0, etc.)
4. Create Planning Documentation Files
IMPORTANT: After completing planning phases, create actual documentation files that the user can keep, update, and version control.
Ask User About Documentation Location
Before creating files, ask where to put documentation:
docs/planning/(recommended for most projects)planning/(root-level planning folder).claude/planning/(keep with Claude Code files)- Custom location
Documentation Files to Create
For comprehensive planning, create these files:
1. docs/planning/overview.md - Executive summary and key decisions 2. docs/planning/features.md - Feature list, priorities, and roadmap 3. docs/planning/architecture.md - Architecture pattern and rationale 4. docs/planning/tech-stack.md - Technology choices and justification 5. docs/planning/ui-ux.md - Design system, navigation, screens 6. docs/planning/data-model.md - Data entities and relationships (if applicable) 7. docs/planning/personas.md - User personas (if created) 8. docs/planning/roadmap.md - Timeline and milestones
For focused planning (architecture only, tech stack only), create only relevant files.
Templates for Each Documentation File
File 1: overview.md
# [App Name] - Overview
**Last Updated**: [Date]
## Quick Summary
- **Purpose**: [One sentence - what problem does this solve?]
- **Target Users**: [Primary audience]
- **Platform**: iOS [version]+
- **Project Type**: [Personal/Client/Startup/Enterprise]
- **Status**: [Planning/In Development/Production]
## Vision
[2-3 sentences describing the app's vision and core value proposition]
## Key Decisions
### Architecture
- **Pattern**: [MVVM/TCA/MVC/etc.]
- **Rationale**: [Why this choice]
### Tech Stack
- **UI**: [SwiftUI/UIKit/Hybrid]
- **Min iOS**: [Version]
- **Persistence**: [Core Data/SwiftData/etc.]
- **Backend**: [CloudKit/Firebase/Custom/None]
### Timeline
- **MVP**: [Date/timeframe]
- **v1.0**: [Target launch]
## Key Risks & Mitigation
1. [Risk 1] - [Mitigation strategy]
2. [Risk 2] - [Mitigation strategy]
## Success Metrics
- [Metric 1]
- [Metric 2]
- [Metric 3]
## Related Documents
- [features.md](./features.md) - Feature list and roadmap
- [architecture.md](./architecture.md) - Architecture details
- [tech-stack.md](./tech-stack.md) - Technology choices
- [ui-ux.md](./ui-ux.md) - Design and UXFile 2: features.md
# [App Name] - Features
**Last Updated**: [Date]
## MVP Features (v1.0)
### Feature 1: [Name]
- **Priority**: High/Medium/Low
- **Complexity**: Low/Medium/High
- **Description**: [What it does]
- **User Value**: [Why users need this]
- **Dependencies**: [Other features needed first]
- **Status**: [ ] Not Started / [ ] In Progress / [x] Complete
### Feature 2: [Name]
[Same structure]
## Post-MVP Features (v1.1+)
### Feature 3: [Name]
- **Target Version**: v1.1 / v2.0
- **Priority**: High/Medium/Low
- **Description**: [What it does]
- **Why Later**: [Rationale for not including in MVP]
## Future Considerations
- [Feature idea 1]
- [Feature idea 2]
## Feature Dependencies
Feature A ├── Feature B (depends on A) └── Feature C (depends on A)
## Feature Estimates
| Feature | Complexity | Effort | Priority |
|---------|-----------|--------|----------|
| Feature 1 | Medium | 2 weeks | High |
| Feature 2 | Low | 3 days | High |
| Feature 3 | High | 4 weeks | Medium |File 3: architecture.md
# [App Name] - Architecture
**Last Updated**: [Date]
## Architecture Pattern
**Chosen Pattern**: [MVVM/TCA/MVC/VIPER]
### Rationale
[Why this pattern was chosen for this specific app]
### Alternatives Considered
- **[Pattern 1]**: [Why not chosen]
- **[Pattern 2]**: [Why not chosen]
## Project Structure
AppName/ ├── App/ │ ├── AppName.swift │ └── Configuration/ ├── Features/ │ ├── FeatureA/ │ │ ├── Views/ │ │ ├── ViewModels/ │ │ └── Models/ │ └── FeatureB/ ├── Shared/ │ ├── Components/ │ ├── Extensions/ │ └── Utilities/ ├── Services/ │ ├── DataService/ │ └── NetworkService/ └── Resources/ ├── Assets.xcassets └── Localizable.strings
## Layer Responsibilities
### Presentation Layer (Views)
- SwiftUI views or UIKit view controllers
- UI presentation only
- Binds to ViewModels
- No business logic
### Business Logic Layer (ViewModels)
- Presentation logic
- State management
- Coordinates between View and Data layers
- Testable without UI
### Data Layer (Models & Services)
- Domain models
- Data access (repositories)
- API communication
- Persistence management
## Data Flow
User Action ↓ View ↓ ViewModel (handles action) ↓ Service/Repository ↓ Model (data) ↓ ViewModel (transforms for presentation) ↓ View (updates UI)
## Key Architectural Decisions
### 1. [Decision Name]
- **Decision**: [What was decided]
- **Context**: [Why it mattered]
- **Rationale**: [Why this choice]
- **Consequences**: [Trade-offs]
### 2. [Decision Name]
[Same structure]
## Testing Strategy
### Unit Tests
- ViewModels (business logic)
- Services and repositories
- Utilities and extensions
- **Coverage Goal**: 70%+
### UI Tests
- Critical user flows
- Key navigation paths
## Future Considerations
- [Potential architecture evolution]
- [Migration strategy if needed]File 4: tech-stack.md
# [App Name] - Tech Stack
**Last Updated**: [Date]
## UI Framework
**Choice**: [SwiftUI/UIKit/Hybrid]
### Rationale
[Why this choice for this app]
### Version Support
- **Minimum iOS**: [e.g., iOS 17 for broad reach]
- **Target iOS**: [e.g., iOS 26]
- **Rationale**: [Why these versions]
## Persistence
**Choice**: [Core Data/SwiftData/Realm/UserDefaults/File System]
### Rationale
[Why this persistence layer]
### Data Sync
- **Strategy**: [CloudKit/Firebase/Custom/None]
- **Offline Support**: [Yes/No - approach]
## Networking
**Choice**: [URLSession/Alamofire/Moya/Custom]
### Rationale
[Why this networking approach]
### API Details
- **Type**: REST/GraphQL/None
- **Base URL**: [If applicable]
- **Authentication**: [Method if needed]
## Dependency Management
**Choice**: [Swift Package Manager/CocoaPods/Carthage]
### Rationale
[Why this dependency manager]
## Third-Party Dependencies
| Dependency | Purpose | Version | Justification |
|-----------|---------|---------|---------------|
| [Name] | [What it does] | [Version] | [Why needed] |
| [Name] | [What it does] | [Version] | [Why needed] |
### Dependency Guidelines
- Minimize external dependencies
- Prefer native solutions when possible
- All dependencies must be actively maintained
## Development Tools
- **Linting**: SwiftLint
- **Formatting**: SwiftFormat (optional)
- **Analytics**: [Tool if needed]
- **Crash Reporting**: [Tool if needed]
## Backend Services
**Choice**: [CloudKit/Firebase/Supabase/Custom/None]
### Services Used
- [ ] Authentication
- [ ] Database/Storage
- [ ] Analytics
- [ ] Push Notifications
- [ ] Cloud Functions
### Rationale
[Why this backend choice]
## CI/CD
**Choice**: [Xcode Cloud/GitHub Actions/Bitrise/Other]
### Pipeline
- Automated builds
- Automated testing
- TestFlight deployment
## Alternative Considered
### [Alternative 1]
- **What**: [Alternative tech choice]
- **Pros**: [Benefits]
- **Cons**: [Drawbacks]
- **Why Not Chosen**: [Reason]
## Tech Stack Summary
UI: [SwiftUI] iOS: [15+] Architecture: [MVVM] Persistence: [Core Data] Backend: [CloudKit] Networking: [URLSession] Dependencies: [SPM] CI/CD: [Xcode Cloud]
## Migration Considerations
[If tech stack might change later, note migration paths]File 5: ui-ux.md
# [App Name] - UI/UX Design
**Last Updated**: [Date]
## Design System
### Color Palette
**Light Mode:**
- Primary: `#XXXXXX` (Purpose)
- Secondary: `#XXXXXX` (Purpose)
- Background: System background
- Text: System label
**Dark Mode:**
- Primary: `#XXXXXX`
- Secondary: `#XXXXXX`
- Background: System background
- Text: System label
### Typography
**Font**: [SF Pro/Custom font]
**Text Styles:**
- Large Title: 34pt, Bold
- Title: 28pt, Regular
- Headline: 17pt, Semibold
- Body: 17pt, Regular
- Caption: 12pt, Regular
**Dynamic Type**: ✅ Supported
### Spacing
**Base Unit**: 8pt
**Scale**:
- XXS: 4pt
- XS: 8pt
- S: 12pt
- M: 16pt
- L: 24pt
- XL: 32pt
- XXL: 48pt
## Navigation
**Primary Pattern**: [Tab Bar/Sidebar/Navigation Stack]
### Rationale
[Why this navigation pattern]
### Tab Bar Structure (if applicable)
1. **Tab 1**: [Name] - [Icon] - [Purpose]
2. **Tab 2**: [Name] - [Icon] - [Purpose]
3. **Tab 3**: [Name] - [Icon] - [Purpose]
## Screens
### Screen 1: [Name]
- **Purpose**: [What users do here]
- **Navigation**: [How users get here]
- **Key Elements**: [Main UI components]
- **States**: Loading, Empty, Error, Success
### Screen 2: [Name]
[Same structure]
## User Flows
### Flow 1: [Primary User Flow]Launch ↓ Home Screen ↓ Action Button ↓ Detail View ↓ Completion
### Flow 2: [Another Flow]
[Same structure]
## Accessibility
### VoiceOver
- [ ] All interactive elements labeled
- [ ] Meaningful labels (not just "Button")
- [ ] Logical navigation order
- [ ] Tested with VoiceOver
### Dynamic Type
- [ ] All text uses text styles
- [ ] Layout adapts to larger text
- [ ] Tested at largest size
### Color Contrast
- [ ] WCAG AA compliance (4.5:1 for text)
- [ ] Not relying on color alone for information
### Other
- [ ] Reduce Motion support
- [ ] Haptic feedback
- [ ] Clear tap targets (44pt minimum)
## Platform Considerations
### iPhone
- Supported sizes: [All/iPhone 13 and newer]
- Orientation: [Portrait only/Both]
### iPad
- Support: [Yes/No/Future]
- Layout: [Adaptive/Optimized]
### Mac Catalyst
- Support: [Yes/No/Future]
## Design Assets
- **App Icon**: [Status - designed/placeholder]
- **Launch Screen**: [Approach]
- **SF Symbols**: [Symbols used]
- **Custom Icons**: [If any]
## Onboarding
### First Launch
- [ ] Welcome screen
- [ ] Feature highlights
- [ ] Permission requests (with rationale)
- [ ] Optional tutorial
## Empty States
- [Screen] when empty: [Message/visual]
- [Feature] when no data: [Message/visual]
## Error States
- Network error: [Message and UI]
- Data error: [Message and UI]
- Permission denied: [Message and UI]
## Loading States
- Initial load: [Loading indicator type]
- Pull to refresh: [System/Custom]
- Pagination: [Approach]File 6: data-model.md (if applicable)
# [App Name] - Data Model
**Last Updated**: [Date]
## Entities
### Entity 1: [Name]
**Purpose**: [What this entity represents]
**Attributes**:
- `id`: UUID (unique identifier)
- `attribute1`: String (description)
- `attribute2`: Date (description)
- `attribute3`: Double (description)
**Relationships**:
- `relationshipName`: Relationship to [OtherEntity] (one-to-many/many-to-one)
**Validation**:
- [Validation rule 1]
- [Validation rule 2]
### Entity 2: [Name]
[Same structure]
## Relationships
Entity1 ├── one-to-many → Entity2 └── many-to-one → Entity3
Entity2 └── many-to-many → Entity4
## Data Flow
### Create
1. User creates [entity] via UI
2. ViewModel validates input
3. Repository creates entity in persistence layer
4. UI updates with new entity
### Read
1. ViewModel requests data from repository
2. Repository fetches from persistence layer
3. Data transformed for presentation
4. UI displays data
### Update
1. User modifies [entity]
2. ViewModel validates changes
3. Repository updates persistence layer
4. UI reflects changes
### Delete
1. User confirms deletion
2. ViewModel requests deletion
3. Repository removes from persistence
4. UI updates
## Persistence Strategy
**Technology**: [Core Data/SwiftData]
**Context Management**:
- Main context: UI operations
- Background context: Heavy operations
**Fetch Strategies**:
- Batching: [Yes/No - batch size]
- Faulting: [Approach]
- Prefetching: [Relationships to prefetch]
## Cloud Sync
**Strategy**: [CloudKit/Firebase/None]
**Conflict Resolution**:
[How conflicts are handled]
**Sync Triggers**:
- App launch
- Significant data change
- Manual sync option
## Migration Strategy
**Version 1**: Initial schema
**Future Migrations**:
[Plan for schema changes]
## Sample Data
// Example entity let example = Entity1( id: UUID(), attribute1: "Example", attribute2: Date(), attribute3: 123.45 )
File 7: personas.md (if created)
# [App Name] - User Personas
**Last Updated**: [Date]
## Persona 1: [Name]
**Photo/Avatar**: [Optional]
### Demographics
- **Age**: [Age range]
- **Occupation**: [Job/role]
- **Location**: [Where they live]
- **Tech Savviness**: Low/Medium/High
### Background
[2-3 sentences about this person's background and context]
### Goals
- [Goal 1]
- [Goal 2]
- [Goal 3]
### Pain Points
- [Pain point 1]
- [Pain point 2]
- [Pain point 3]
### How [App Name] Helps
[How your app solves their problems]
### User Journey
1. [Discovery - how they find the app]
2. [Onboarding - first experience]
3. [Regular Usage - typical use case]
4. [Value Realization - when they see benefit]
### Quote
> "[A quote that represents this persona's perspective]"
## Persona 2: [Name]
[Same structure]
## Persona Comparison
| Aspect | Persona 1 | Persona 2 |
|--------|-----------|-----------|
| Primary Goal | [Goal] | [Goal] |
| Key Pain Point | [Pain] | [Pain] |
| Usage Frequency | Daily | Weekly |
| Key Feature | [Feature] | [Feature] |File 8: roadmap.md
# [App Name] - Roadmap
**Last Updated**: [Date]
## Timeline Overview
Planning Development Testing Launch |==============|===============|===========|=====> [Date range] [Date range] [Date range] [Date]
## Milestones
### Milestone 1: Project Setup
**Target**: [Date/Week 1]
- [ ] Create Xcode project
- [ ] Set up git repository
- [ ] Configure CI/CD
- [ ] Create initial project structure
- [ ] Set up dependencies
### Milestone 2: Core Architecture
**Target**: [Date/Week 2]
- [ ] Implement MVVM structure
- [ ] Set up Core Data/persistence
- [ ] Create base ViewModels
- [ ] Set up networking layer
### Milestone 3: MVP Features
**Target**: [Date/Weeks 3-6]
- [ ] Feature 1 implementation
- [ ] Feature 2 implementation
- [ ] Feature 3 implementation
- [ ] Basic UI/UX
- [ ] Integration testing
### Milestone 4: Polish & Testing
**Target**: [Date/Week 7-8]
- [ ] UI polish
- [ ] Accessibility implementation
- [ ] Performance optimization
- [ ] Bug fixes
- [ ] User testing
### Milestone 5: Launch Prep
**Target**: [Date/Week 9]
- [ ] App Store assets
- [ ] Privacy policy
- [ ] App Store submission
- [ ] Marketing materials
- [ ] Support documentation
### Milestone 6: v1.0 Launch
**Target**: [Date]
- [ ] Submit to App Store
- [ ] App Review
- [ ] Public release
- [ ] Monitor analytics & crashes
- [ ] Gather user feedback
## Version Planning
### v1.0 - MVP (Launch)
- Core features only
- Stable and polished
- **Target**: [Date]
### v1.1 - Quick Improvements
- User feedback incorporated
- Quick wins
- Performance improvements
- **Target**: [Date - 1 month after launch]
### v2.0 - Major Update
- [Major feature 1]
- [Major feature 2]
- Significant improvements
- **Target**: [Date - 3-6 months after launch]
## Feature Release Schedule
| Version | Features | Target Date |
|---------|----------|-------------|
| v1.0 | [Feature 1, 2, 3] | [Date] |
| v1.1 | [Feature 4, improvements] | [Date] |
| v1.2 | [Feature 5, 6] | [Date] |
| v2.0 | [Major features] | [Date] |
## Dependencies & Blockers
### Current Blockers
- [Blocker 1 - impact and mitigation]
- [Blocker 2 - impact and mitigation]
### External Dependencies
- [Dependency 1 - impact on timeline]
- [Dependency 2 - impact on timeline]
## Risks
| Risk | Impact | Probability | Mitigation |
|------|--------|-------------|------------|
| [Risk 1] | High/Med/Low | High/Med/Low | [Strategy] |
| [Risk 2] | High/Med/Low | High/Med/Low | [Strategy] |
## Resource Allocation
- **Development**: [X hours/weeks]
- **Design**: [X hours/weeks]
- **Testing**: [X hours/weeks]
- **Marketing**: [X hours/weeks]
## Success Metrics
### Launch Metrics (v1.0)
- Downloads: [Target]
- Active users: [Target]
- Crash-free rate: >99%
- App Store rating: >4.0
### 3-Month Metrics
- Downloads: [Target]
- Daily active users: [Target]
- Retention: [Target]%
- [Custom metric]: [Target]
## Notes
[Any additional timeline notes, assumptions, or considerations]5. Provide Recommendations
After planning, provide tailored recommendations:
Recommendations Format
## 📋 Planning Recommendations
### High Priority Decisions Needed
1. [Critical decision 1 - options and recommendation]
2. [Critical decision 2 - options and recommendation]
### Suggested Next Steps
1. **Immediate**: [What to do first]
2. **Week 1**: [Early tasks]
3. **Week 2-4**: [MVP development focus]
### Resource Recommendations
- [Tool recommendations]
- [Library recommendations]
- [Learning resources if needed]
### Potential Challenges
- [Challenge 1 - mitigation strategy]
- [Challenge 2 - mitigation strategy]
### Time Estimates
- Planning & Setup: [X days/weeks]
- MVP Development: [X weeks/months]
- Testing & Polish: [X weeks]
- App Store Submission: [X weeks]6. Analysis Process for Existing Apps
Note: This section is for analyzing existing apps. For new apps, use Section 3 instead.
When analyzing an existing app, follow this systematic approach:
Step 1: Discover the Codebase
Use Glob and Grep tools to understand the project structure:
Key Discovery Tasks: 1. Identify project structure
- Use Glob to find main directories
- Identify file organization pattern
- Locate main app files, views, models
2. Detect tech stack
- SwiftUI vs UIKit (search for "import SwiftUI" vs "UIViewController")
- Architecture hints (look for ViewModels, Coordinators, Interactors)
- Persistence layer (search for Core Data, SwiftData, Realm imports)
- Third-party dependencies (check Package.swift, Podfile)
3. Assess codebase size and complexity
- Count Swift files
- Identify main features/modules
- Note file sizes (potential massive files)
Step 2: Analyze Current State
Based on the analysis scope, evaluate different aspects:
Architecture Analysis:
- Current Pattern: What architecture is being used (MVVM, MVC, mixed)?
- Consistency: Is the pattern applied consistently?
- Separation of Concerns: Are responsibilities properly separated?
- Code Organization: How is code organized (by feature, by layer)?
- Recommendation: Should architecture be changed or improved?
Tech Stack Evaluation:
- UI Framework: SwiftUI/UIKit usage, is it appropriate?
- Minimum iOS: What's the deployment target, should it change?
- Persistence: What's being used, is it the right choice?
- Dependencies: List third-party dependencies, are they necessary?
- Networking: How is networking handled?
- Recommendation: Tech stack improvements or migrations
Code Quality Assessment:
- File Sizes: Any massive files (>500 lines)?
- Code Duplication: Patterns of repeated code
- Naming Conventions: Consistent and clear?
- Comments: Adequate documentation?
- Testing: Test coverage, test quality
- Recommendation: Priority refactoring areas
Feature Analysis:
- Current Features: List what the app does
- Feature Organization: How are features structured?
- Missing Features: Gaps or incomplete features
- Feature Quality: Well-implemented or need work?
- Recommendation: Feature priorities
Performance & Best Practices:
- Memory Management: Retain cycles, memory leaks
- SwiftUI Patterns: State management issues
- Core Data Usage: Context management, fetch patterns
- Error Handling: How errors are handled
- Recommendation: Performance improvements
UI/UX State:
- HIG Compliance: Basic compliance check
- Accessibility: VoiceOver support, Dynamic Type
- Navigation: Navigation patterns used
- Design Consistency: Consistent UI patterns
- Recommendation: UI/UX improvements
Step 3: Identify Issues and Gaps
Create a comprehensive issues list:
Critical Issues (must fix):
- Architecture problems causing bugs
- Performance bottlenecks
- Security vulnerabilities
- Crashes or critical bugs
Medium Priority (should fix):
- Code maintainability issues
- Missing best practices
- Incomplete features
- Technical debt
Low Priority (nice to have):
- Code style improvements
- Minor optimizations
- Documentation gaps
Step 4: Create Analysis Documentation Files
IMPORTANT: Create actual documentation files for the analysis that can be tracked and referenced.
Ask User About Documentation Location
Before creating files, ask where to put analysis documentation:
docs/analysis/(recommended)analysis/(root-level).claude/analysis/(keep with Claude Code files)- Custom location
Documentation Files to Create
For existing app analysis, create TWO sets of files:
Current State Documentation (what exists now): 1. docs/current/overview.md - Current app overview and status 2. docs/current/features.md - Current features and capabilities 3. docs/current/architecture.md - Current architecture and patterns 4. docs/current/tech-stack.md - Current technology stack 5. docs/current/ui-ux.md - Current UI/UX state (optional) 6. docs/current/data-model.md - Current data model (if applicable)
Analysis & Improvement Documentation (what needs to change): 7. docs/analysis/analysis-report.md - Full analysis and assessment 8. docs/analysis/recommendations.md - Prioritized improvement recommendations 9. docs/analysis/issues.md - Issues tracker with priorities 10. docs/analysis/roadmap.md - Improvement roadmap and timeline
Rationale: Separating current state from improvements provides:
- Clear baseline documentation (what exists)
- Clear improvement path (what to change)
- Knowledge transfer for new team members
- Historical record of app state
- Comparison point for measuring progress
Current State Documentation Templates
File 1: docs/current/overview.md
# [App Name] - Current State Overview
**Last Updated**: [Date]
**Analysis Date**: [Date]
## App Summary
- **Name**: [App Name]
- **Bundle ID**: [Bundle identifier]
- **Current Version**: [Version in App Store / Development]
- **Platform**: iOS [deployment target]+
- **Status**: [In Development / Production / Maintenance]
- **Team Size**: [Solo / Small / Medium / Large]
## Purpose
[What the app does - 2-3 sentences]
## Current Users
- **Target Audience**: [Who uses it]
- **User Base**: [Number of users if known]
- **Primary Use Cases**: [How users use it]
## Key Information
### Technical Overview
- **Architecture**: [MVVM/MVC/TCA/Mixed]
- **UI Framework**: [SwiftUI/UIKit/Hybrid]
- **Min iOS Version**: [Version]
- **Persistence**: [Core Data/SwiftData/Realm/etc.]
- **Backend**: [CloudKit/Firebase/Custom/None]
### Codebase Stats
- **Swift Files**: [Count]
- **Screens/Features**: [Count]
- **Lines of Code**: [Approximate]
- **Test Coverage**: [Percentage if known]
### App Store Presence
- **Listed**: [Yes/No]
- **Category**: [Category]
- **Rating**: [Rating if applicable]
- **Last Update**: [Date]
## Current State Assessment
- **Overall Health**: [Excellent/Good/Fair/Needs Work]
- **Code Quality**: [X/10]
- **Architecture**: [X/10]
- **Documentation**: [X/10]
- **Test Coverage**: [X/10]
## Known Issues
1. [Major known issue 1]
2. [Major known issue 2]
3. [Major known issue 3]
## Recent Changes
- [Recent significant change 1]
- [Recent significant change 2]
## Related Documents
- [features.md](./features.md) - Current features
- [architecture.md](./architecture.md) - Current architecture
- [tech-stack.md](./tech-stack.md) - Current tech stack
- [../analysis/analysis-report.md](../analysis/analysis-report.md) - Analysis & recommendationsFile 2: docs/current/features.md
# [App Name] - Current Features
**Last Updated**: [Date]
## Core Features
### Feature 1: [Name]
- **Status**: ✅ Complete / 🚧 Partial / ❌ Broken
- **Location**: [File/Module]
- **Description**: [What it does]
- **Quality**: [Well-implemented / Needs work / Has issues]
- **Usage**: [Heavily used / Moderately used / Rarely used]
- **Known Issues**: [List issues if any]
### Feature 2: [Name]
[Same structure]
### Feature 3: [Name]
[Same structure]
## Secondary Features
### Feature 4: [Name]
[Same structure]
## Incomplete/Partial Features
### Feature X: [Name]
- **Status**: 🚧 Incomplete
- **What Works**: [Completed parts]
- **What's Missing**: [Missing functionality]
- **Why Incomplete**: [Reason if known]
## Deprecated/Legacy Features
### Old Feature: [Name]
- **Status**: ⚠️ Deprecated
- **Replacement**: [New feature or none]
- **Should Remove**: [Yes/No - why]
## Feature Categories
### User-Facing Features
- [Feature 1]
- [Feature 2]
- [Feature 3]
### System Features
- [Authentication]
- [Data sync]
- [Notifications]
## Feature Quality Matrix
| Feature | Status | Quality | Issues | Priority |
|---------|--------|---------|--------|----------|
| [Feature 1] | ✅ | Good | None | High |
| [Feature 2] | 🚧 | Fair | [Issues] | Medium |
| [Feature 3] | ✅ | Poor | [Issues] | High |
## Features by Module/Screen
### [Module/Screen 1]
- Feature A
- Feature B
### [Module/Screen 2]
- Feature C
- Feature D
## User Journeys
### Journey 1: [Primary Use Case][Screen 1] → [Action] → [Screen 2] → [Completion]
**Status**: [Works well / Has issues]
### Journey 2: [Another Use Case]
[Same structure]
## Related Documents
- [overview.md](./overview.md) - App overview
- [architecture.md](./architecture.md) - How features are implemented
- [../analysis/recommendations.md](../analysis/recommendations.md) - Feature improvementsFile 3: docs/current/architecture.md
# [App Name] - Current Architecture
**Last Updated**: [Date]
## Architecture Pattern
**Current Pattern**: [MVVM/MVC/TCA/VIPER/Mixed]
**Consistency**: [Highly consistent / Mostly consistent / Inconsistent / Very mixed]
**Assessment**: [2-3 sentences about architecture state]
## Current Project Structure
[AppName]/ ├── [Actual folder structure from codebase] ├── ├── └──
**Organization Method**: [By feature / By layer / Mixed / Unclear]
**Assessment**: [Is structure logical and maintainable?]
## Layer Breakdown
### Presentation Layer
**Files**: [Count]
**Pattern**: [SwiftUI Views / UIViewControllers]
**Quality**: [Assessment]
**Issues**: [List issues]
### Business Logic Layer
**Files**: [Count]
**Pattern**: [ViewModels / Presenters / Controllers]
**Quality**: [Assessment]
**Issues**: [List issues]
### Data Layer
**Files**: [Count]
**Pattern**: [Repositories / Services / Direct access]
**Quality**: [Assessment]
**Issues**: [List issues]
## Actual Data Flow
**Observed Pattern**:[How data actually flows in the current app]
**Issues**: [Any flow issues observed]
## Architecture Debt
### Mixed Patterns
- [Location where pattern 1 used]
- [Location where pattern 2 used]
- **Impact**: [How this affects development]
### Massive Files
| File | Lines | Should Be | Effort to Fix |
|------|-------|-----------|---------------|
| [File1.swift] | [XXX] | [Split into X files] | [Effort] |
| [File2.swift] | [XXX] | [Split into X files] | [Effort] |
### Tight Coupling
- [Component 1] ↔ [Component 2] - [Issue]
- [Component 3] ↔ [Component 4] - [Issue]
### Missing Abstractions
- [Area lacking abstraction 1]
- [Area lacking abstraction 2]
## Code Organization
### Strengths
- ✅ [What's good about current organization]
- ✅ [Another strength]
### Weaknesses
- ❌ [What's problematic]
- ❌ [Another issue]
## Testing Architecture
**Current State**:
- **Unit Tests**: [Count] files, [X%] coverage
- **UI Tests**: [Count] files
- **Test Quality**: [Assessment]
- **Testability**: [How easy to test - Good/Fair/Poor]
## Dependencies
**External Dependencies**: [Count]
**Dependency Management**: [SPM/CocoaPods/Carthage/Mixed]
**Dependency Issues**: [Any problematic dependencies]
## Related Documents
- [overview.md](./overview.md) - App overview
- [tech-stack.md](./tech-stack.md) - Technology details
- [../analysis/recommendations.md](../analysis/recommendations.md) - Architecture improvementsFile 4: docs/current/tech-stack.md
# [App Name] - Current Tech Stack
**Last Updated**: [Date]
## UI Framework
**Current**: [SwiftUI/UIKit/Hybrid]
**Details**:
- SwiftUI: [Percentage or areas]
- UIKit: [Percentage or areas]
- Hybrid Strategy: [How mixed]
**Assessment**: [Is current choice appropriate?]
## iOS Version Support
**Deployment Target**: iOS [X]
**Latest Tested**: iOS [X]
**Assessment**:
- [Too old / Appropriate / Could be higher]
- **Impact**: [Benefits/limitations of current target]
## Persistence
**Current**: [Core Data/SwiftData/Realm/UserDefaults/File System]
**Details**:
- Entities: [Count]
- Complexity: [Simple/Medium/Complex]
- Performance: [Good/Fair/Poor]
**Assessment**: [Is choice appropriate for needs?]
## Data Sync
**Strategy**: [CloudKit/Firebase/Custom/None]
**Details**:
- Working: [Yes/No/Partially]
- Conflicts: [How handled]
- Issues: [Any sync issues]
## Networking
**Library**: [URLSession/Alamofire/Moya/Custom]
**Details**:
- API Type: [REST/GraphQL/None]
- Error Handling: [Good/Fair/Poor]
- Offline Support: [Yes/No/Partial]
**Assessment**: [Appropriate for needs?]
## Dependency Management
**Current**: [SPM/CocoaPods/Carthage/Mixed/None]
**Details**:
- Total Dependencies: [Count]
- Management Quality: [Good/Fair/Poor]
## Third-Party Dependencies
| Dependency | Version | Purpose | Status | Issues |
|-----------|---------|---------|--------|--------|
| [Name] | [X.X.X] | [Purpose] | ✅ Updated / ⚠️ Outdated | [Any issues] |
| [Name] | [X.X.X] | [Purpose] | ✅ Updated / ⚠️ Outdated | [Any issues] |
### Deprecated Dependencies
- [Dependency name] - [Why deprecated, what to use instead]
### Unnecessary Dependencies
- [Dependency that could be removed] - [Why not needed]
## Development Tools
**Currently Used**:
- **Linting**: [SwiftLint / None]
- **Formatting**: [SwiftFormat / None]
- **Analytics**: [Tool / None]
- **Crash Reporting**: [Tool / None]
## Backend Services
**Provider**: [CloudKit/Firebase/Supabase/Custom/None]
**Services Used**:
- [x] Authentication - [Status]
- [x] Database - [Status]
- [ ] Analytics - [Not used]
- [ ] Push Notifications - [Not used]
**Assessment**: [Working well / Has issues / Could be improved]
## CI/CD
**Current Setup**: [Xcode Cloud/GitHub Actions/Bitrise/None]
**Pipeline**:
- Automated builds: [Yes/No]
- Automated testing: [Yes/No]
- TestFlight deployment: [Yes/No]
**Assessment**: [Adequate / Needs improvement / Not setup]
## Build Configuration
**Configurations**: [Debug, Release, other]
**Build Time**: [Approximate time]
**Issues**: [Slow builds, configuration issues, etc.]
## Tech Stack Summary
UI: [SwiftUI/UIKit] iOS Target: [Version] Architecture: [Pattern] Persistence: [Technology] Backend: [Service/None] Networking: [Library] Dependencies: [Manager] CI/CD: [Tool/None]
## Technology Debt
### Outdated Technologies
- [Technology 1] - Current: [Version], Latest: [Version]
- [Technology 2] - Current: [Version], Latest: [Version]
### Missing Modern Features
- [Feature available in newer iOS] - Requires iOS [X]
- [Another feature] - Requires iOS [X]
## Related Documents
- [overview.md](./overview.md) - App overview
- [architecture.md](./architecture.md) - Architecture patterns
- [../analysis/recommendations.md](../analysis/recommendations.md) - Tech stack improvementsFile 5: docs/current/ui-ux.md (Optional - if doing UI/UX analysis)
# [App Name] - Current UI/UX State
**Last Updated**: [Date]
## Current Design System
### Colors
**Current Usage**: [Consistent / Mixed / Inconsistent]
**Observed Colors**:
- Primary: [Color/None defined]
- Secondary: [Color/None defined]
- Background: [System/Custom]
**Assessment**: [Has design system / Inconsistent / No system]
### Typography
**Font**: [SF Pro/Custom/Mixed]
**Dynamic Type**: [Supported / Partial / Not supported]
**Assessment**: [Consistent / Inconsistent]
### Spacing
**System**: [8pt grid / Inconsistent / No system]
**Assessment**: [Consistent / Needs improvement]
## Navigation
**Pattern**: [Tab Bar/Sidebar/Stack/Mixed]
**Details**:
- Tabs: [Count if applicable]
- Hierarchy: [Clear / Confusing]
- Back navigation: [Works well / Has issues]
**Assessment**: [Good / Could be improved / Confusing]
## Screen Inventory
### Main Screens
1. **[Screen Name]** - [Brief description] - Quality: [Good/Fair/Poor]
2. **[Screen Name]** - [Brief description] - Quality: [Good/Fair/Poor]
3. **[Screen Name]** - [Brief description] - Quality: [Good/Fair/Poor]
### Secondary Screens
[List]
## HIG Compliance
**Overall**: [Compliant / Mostly / Many issues]
**Issues Found**:
- [HIG violation 1]
- [HIG violation 2]
- [HIG violation 3]
## Accessibility
**VoiceOver**: [Supported / Partial / Not supported]
**Dynamic Type**: [Supported / Partial / Not supported]
**Color Contrast**: [Good / Some issues / Many issues]
**Assessment**: [Well implemented / Needs work / Poor]
## User Experience Issues
### Major Issues
- [UX issue 1]
- [UX issue 2]
### Minor Issues
- [Minor issue 1]
- [Minor issue 2]
## Strengths
- ✅ [UI/UX strength 1]
- ✅ [UI/UX strength 2]
## Related Documents
- [../analysis/recommendations.md](../analysis/recommendations.md) - UI/UX improvementsFile 6: docs/current/data-model.md (If applicable)
# [App Name] - Current Data Model
**Last Updated**: [Date]
## Persistence Technology
[Core Data / SwiftData / Realm / Other]
## Current Entities
### Entity 1: [Name]
**Attributes**:
- [attribute1]: [Type]
- [attribute2]: [Type]
**Relationships**:
- [relationship]: to [Entity]
**Issues**: [Any issues with this entity]
### Entity 2: [Name]
[Same structure]
## Current Relationships
[Entity1] ←→ [Entity2] (relationship type) [Entity2] → [Entity3] (relationship type)
## Data Flow
**Current**: [How data currently flows through the app]
**Issues**: [Any data flow problems]
## Performance
**Fetch Performance**: [Good / Fair / Slow]
**Save Performance**: [Good / Fair / Slow]
**Known Bottlenecks**: [List if any]
## Migration History
**Current Version**: [Schema version]
**Migrations**: [Count of migrations performed]
**Issues**: [Any migration issues]
## Related Documents
- [architecture.md](./architecture.md) - How data layer is organized
- [../analysis/recommendations.md](../analysis/recommendations.md) - Data model improvements---
Analysis File Templates
File 7: docs/analysis/analysis-report.md
# [App Name] - Analysis Report
## Executive Summary
- **App Purpose**: [What the app does]
- **Codebase Size**: [Number of files, screens]
- **Current Tech Stack**: [List main technologies]
- **Overall Health**: [Rating: Excellent/Good/Fair/Needs Work]
- **Primary Concerns**: [Top 3 issues]
## Current State
### Architecture
- **Pattern**: [MVVM/MVC/etc.]
- **Consistency**: [Assessment]
- **Rating**: X/10
- **Notes**: [Key observations]
### Tech Stack
- **UI Framework**: [SwiftUI/UIKit/Hybrid]
- **iOS Target**: [Version]
- **Persistence**: [Core Data/etc.]
- **Dependencies**: [List]
- **Rating**: X/10
- **Notes**: [Assessment]
### Code Quality
- **Organization**: [Assessment]
- **File Sizes**: [Average, largest files]
- **Naming**: [Assessment]
- **Testing**: [Coverage, quality]
- **Rating**: X/10
- **Notes**: [Key findings]
### Features
- **Current Features**: [List]
- **Feature Quality**: [Assessment]
- **Gaps**: [Missing features]
- **Rating**: X/10
### UI/UX
- **HIG Compliance**: [Basic assessment]
- **Accessibility**: [State]
- **Navigation**: [Patterns used]
- **Rating**: X/10
## Issues Found
### Critical (Must Fix)
1. [Issue 1 - Location - Impact - Recommendation]
2. [Issue 2 - Location - Impact - Recommendation]
### Medium Priority (Should Fix)
1. [Issue - Recommendation]
2. [Issue - Recommendation]
### Low Priority (Nice to Have)
1. [Issue - Recommendation]
## Recommendations
### Immediate Actions (Week 1)
1. [Action 1 - Why - Impact]
2. [Action 2 - Why - Impact]
### Short-term Improvements (Month 1)
1. [Improvement - Benefits]
2. [Improvement - Benefits]
### Long-term Strategy (3-6 months)
1. [Strategic change - Rationale]
2. [Strategic change - Rationale]
### Architecture Recommendations
- **Current**: [Current pattern]
- **Recommendation**: [Keep/Migrate/Improve]
- **Rationale**: [Why]
- **Migration Path**: [If applicable]
### Tech Stack Recommendations
- **SwiftUI Migration**: [If UIKit] - [Timeline, approach]
- **Dependency Updates**: [What to update/remove]
- **iOS Version**: [Should deployment target change?]
- **New Additions**: [Recommended libraries/tools]
### Refactoring Priorities
1. **High Priority**: [What - Why - Effort]
2. **Medium Priority**: [What - Why - Effort]
3. **Low Priority**: [What - Why - Effort]
## Estimated Effort
### Quick Wins (1-2 weeks)
- [Item 1]
- [Item 2]
### Medium Effort (1-2 months)
- [Item 1]
- [Item 2]
### Large Effort (3-6 months)
- [Item 1]
- [Item 2]
## Next Steps
1. [ ] [Immediate action 1]
2. [ ] [Immediate action 2]
3. [ ] [Plan refactoring strategy]
4. [ ] [Address critical issues]
5. [ ] [Implement quick wins]File 2: recommendations.md
# [App Name] - Recommendations
**Last Updated**: [Date]
**Analysis Date**: [Date]
## Executive Summary
**Overall App Health**: [Excellent/Good/Fair/Needs Work]
**Top 3 Priorities**:
1. [Priority 1 - Impact]
2. [Priority 2 - Impact]
3. [Priority 3 - Impact]
## Immediate Actions (Week 1)
### 1. [Action Name]
- **Category**: [Architecture/Code Quality/Performance/etc.]
- **Priority**: Critical/High/Medium
- **Effort**: [Hours/Days]
- **Impact**: [Description of benefit]
- **Action Items**:
- [ ] [Specific task 1]
- [ ] [Specific task 2]
### 2. [Action Name]
[Same structure]
## Short-term Improvements (1-2 Months)
### Architecture Improvements
- **Current State**: [Current architecture issues]
- **Recommended Changes**:
- [Change 1 - Rationale]
- [Change 2 - Rationale]
- **Effort**: [Estimate]
- **Benefits**: [Expected improvements]
### Code Quality Improvements
- **Current State**: [Code quality issues]
- **Recommended Changes**:
- [Change 1 - Rationale]
- [Change 2 - Rationale]
- **Effort**: [Estimate]
- **Benefits**: [Expected improvements]
### Tech Stack Updates
- **Current State**: [Tech stack issues]
- **Recommended Changes**:
- [Change 1 - Rationale - Migration path]
- [Change 2 - Rationale - Migration path]
- **Effort**: [Estimate]
- **Benefits**: [Expected improvements]
## Long-term Strategy (3-6 Months)
### Strategic Recommendation 1: [Name]
- **Current State**: [Where we are]
- **Target State**: [Where we want to be]
- **Rationale**: [Why this change]
- **Approach**: [How to get there]
- **Timeline**: [Phases and milestones]
- **Risks**: [Potential issues and mitigation]
### Strategic Recommendation 2: [Name]
[Same structure]
## Technology Migrations
### SwiftUI Migration (if UIKit app)
- **Recommended**: [Yes/No/Partial]
- **Rationale**: [Why or why not]
- **Approach**: [Strategy - feature by feature, new features only, etc.]
- **Timeline**: [When to start, expected completion]
- **Risks**: [Challenges and mitigation]
### Architecture Migration (if recommended)
- **From**: [Current pattern]
- **To**: [Recommended pattern]
- **Rationale**: [Why change]
- **Approach**: [Migration strategy]
- **Timeline**: [Phases]
- **Risks**: [Challenges]
### iOS Version Update
- **Current**: iOS [X]
- **Recommended**: iOS [X]
- **Rationale**: [Benefits of updating]
- **Impact**: [What breaks, what becomes available]
- **Timeline**: [When to update]
## Dependency Recommendations
### Dependencies to Remove
| Dependency | Reason to Remove | Alternative |
|-----------|------------------|-------------|
| [Name] | [Why remove] | [What to use instead] |
### Dependencies to Add
| Dependency | Purpose | Justification |
|-----------|---------|---------------|
| [Name] | [What it does] | [Why needed] |
### Dependencies to Update
| Dependency | Current | Target | Breaking Changes |
|-----------|---------|--------|------------------|
| [Name] | [Version] | [Version] | [Yes/No - Details] |
## Refactoring Priorities
### High Priority
| File/Area | Issue | Recommendation | Effort |
|-----------|-------|----------------|--------|
| [File:Line] | [Problem] | [Solution] | [Hours/Days] |
### Medium Priority
[Same table structure]
### Low Priority
[Same table structure]
## Testing Recommendations
### Unit Testing
- **Current Coverage**: [X%]
- **Target Coverage**: [X%]
- **Priority Areas**:
- [Area 1 - Why important]
- [Area 2 - Why important]
- **Effort**: [Estimate]
### UI Testing
- **Current State**: [Assessment]
- **Recommendations**:
- [Test 1 - Rationale]
- [Test 2 - Rationale]
- **Effort**: [Estimate]
## Performance Optimization
### Performance Issues Found
| Area | Issue | Impact | Recommendation |
|------|-------|--------|----------------|
| [Location] | [Problem] | [User impact] | [Solution] |
### Optimization Priorities
1. **[Optimization 1]** - High impact, low effort
2. **[Optimization 2]** - Medium impact, medium effort
3. **[Optimization 3]** - High impact, high effort
## Security & Privacy
### Security Improvements
- [ ] [Security improvement 1]
- [ ] [Security improvement 2]
### Privacy Enhancements
- [ ] [Privacy enhancement 1]
- [ ] [Privacy enhancement 2]
## UI/UX Improvements
### HIG Compliance
- **Current State**: [Assessment]
- **Recommendations**:
- [Issue 1 - Fix]
- [Issue 2 - Fix]
### Accessibility
- **Current State**: [Assessment]
- **Priority Improvements**:
- [ ] [Improvement 1]
- [ ] [Improvement 2]
## Documentation
### Documentation to Create
- [ ] [Doc 1 - Purpose]
- [ ] [Doc 2 - Purpose]
### Documentation to Update
- [ ] [Doc 1 - What needs updating]
- [ ] [Doc 2 - What needs updating]
## Success Metrics
### Before Improvements
- [Metric 1]: [Current value]
- [Metric 2]: [Current value]
- [Metric 3]: [Current value]
### After Improvements (Expected)
- [Metric 1]: [Target value]
- [Metric 2]: [Target value]
- [Metric 3]: [Target value]
## Related Documents
- [analysis-report.md](./analysis-report.md) - Full analysis
- [issues.md](./issues.md) - Issues tracker
- [roadmap.md](./roadmap.md) - Improvement roadmapFile 3: issues.md
# [App Name] - Issues Tracker
**Last Updated**: [Date]
## Critical Issues (Fix Immediately)
### Issue 1: [Title]
- **Category**: [Bug/Architecture/Performance/Security]
- **Location**: `File.swift:Line`
- **Severity**: Critical
- **Impact**: [How this affects users or app stability]
- **Description**: [Detailed description]
- **Reproduction**: [How to reproduce if bug]
- **Recommendation**: [How to fix]
- **Effort**: [Estimate]
- **Status**: [ ] Open / [ ] In Progress / [ ] Fixed
### Issue 2: [Title]
[Same structure]
## High Priority Issues (Fix Soon)
### Issue 3: [Title]
- **Category**: [Category]
- **Location**: `File.swift:Line`
- **Severity**: High
- **Impact**: [Impact description]
- **Description**: [Details]
- **Recommendation**: [Solution]
- **Effort**: [Estimate]
- **Status**: [ ] Open / [ ] In Progress / [ ] Fixed
## Medium Priority Issues (Plan to Fix)
### Issue 4: [Title]
- **Category**: [Category]
- **Location**: `File.swift:Line`
- **Severity**: Medium
- **Impact**: [Impact description]
- **Description**: [Details]
- **Recommendation**: [Solution]
- **Effort**: [Estimate]
- **Status**: [ ] Open
## Low Priority Issues (Nice to Have)
### Issue 5: [Title]
- **Category**: [Category]
- **Location**: `File.swift:Line`
- **Severity**: Low
- **Impact**: [Impact description]
- **Description**: [Details]
- **Recommendation**: [Solution]
- **Effort**: [Estimate]
- **Status**: [ ] Open
## Issues by Category
### Architecture Issues
- [Issue #1 - Title]
- [Issue #2 - Title]
### Code Quality Issues
- [Issue #3 - Title]
- [Issue #4 - Title]
### Performance Issues
- [Issue #5 - Title]
### Security Issues
- [Issue #6 - Title]
### UI/UX Issues
- [Issue #7 - Title]
### Testing Issues
- [Issue #8 - Title]
## Issues Summary
| Priority | Count | Resolved | Remaining |
|----------|-------|----------|-----------|
| Critical | [X] | [X] | [X] |
| High | [X] | [X] | [X] |
| Medium | [X] | [X] | [X] |
| Low | [X] | [X] | [X] |
| **Total** | **[X]** | **[X]** | **[X]** |
## Resolution Progress
- [X] Issue #1 - [Title] - Fixed on [Date]
- [ ] Issue #2 - [Title] - In progress
- [ ] Issue #3 - [Title] - Open
## Notes
[Any additional context about issues, patterns observed, or considerations]File 4: roadmap.md
# [App Name] - Improvement Roadmap
**Last Updated**: [Date]
**Analysis Date**: [Date]
## Roadmap Overview
Stabilize Improve Modernize Enhance |=============|=============|=============|============> Weeks 1-2 Weeks 3-8 Months 3-6 Ongoing
## Phase 1: Stabilize (Weeks 1-2)
**Goal**: Fix critical issues and implement quick wins
### Critical Fixes
- [ ] [Critical issue 1] - [Effort] - Due: [Date]
- [ ] [Critical issue 2] - [Effort] - Due: [Date]
### Quick Wins
- [ ] [Quick win 1] - [Benefit] - [Effort]
- [ ] [Quick win 2] - [Benefit] - [Effort]
- [ ] [Quick win 3] - [Benefit] - [Effort]
### Success Criteria
- All critical issues resolved
- No crashes on critical paths
- Quick wins shipped
## Phase 2: Improve (Weeks 3-8)
**Goal**: Refactor priority areas and improve code quality
### Week 3-4: Architecture Improvements
- [ ] [Refactoring 1] - [Files affected]
- [ ] [Refactoring 2] - [Files affected]
- [ ] [Improvement 1]
### Week 5-6: Code Quality
- [ ] [Quality improvement 1]
- [ ] [Add tests for critical areas]
- [ ] [Update dependencies]
### Week 7-8: Performance & UX
- [ ] [Performance optimization 1]
- [ ] [UX improvement 1]
- [ ] [Accessibility improvements]
### Success Criteria
- Code quality score improved to [X/10]
- Test coverage at [X%]
- Performance metrics improved by [X%]
## Phase 3: Modernize (Months 3-6)
**Goal**: Major technical improvements and migrations
### Month 3: [Focus Area]
- [ ] [Major improvement 1]
- [ ] [Migration step 1]
### Month 4: [Focus Area]
- [ ] [Major improvement 2]
- [ ] [Migration step 2]
### Month 5-6: [Focus Area]
- [ ] [Complete migration]
- [ ] [Feature enhancements]
- [ ] [Comprehensive testing]
### Success Criteria
- [Major goal achieved]
- [Migration completed]
- [New capabilities enabled]
## Phase 4: Enhance (Ongoing)
**Goal**: Continuous improvement and new features
### Continuous Improvements
- Regular dependency updates
- Code quality maintenance
- Performance monitoring
- Technical debt management
### New Features
- [Feature 1] - [When]
- [Feature 2] - [When]
- [Feature 3] - [When]
## Milestones
### Milestone 1: Critical Issues Resolved
**Target**: [Date - Week 2]
- All critical issues fixed
- Quick wins implemented
- App stability improved
### Milestone 2: Code Quality Improved
**Target**: [Date - Week 8]
- Refactoring complete
- Test coverage at target
- Dependencies updated
### Milestone 3: Modernization Complete
**Target**: [Date - Month 6]
- Migrations finished
- New architecture stabilized
- Performance optimized
## Effort Estimates
### Quick Wins (1-2 Weeks Total)
| Item | Effort | Priority |
|------|--------|----------|
| [Quick win 1] | [X hours] | High |
| [Quick win 2] | [X hours] | High |
| [Quick win 3] | [X hours] | Medium |
### Medium Effort (1-2 Months Total)
| Item | Effort | Priority |
|------|--------|----------|
| [Item 1] | [X weeks] | High |
| [Item 2] | [X weeks] | Medium |
### Large Effort (3-6 Months Total)
| Item | Effort | Priority |
|------|--------|----------|
| [Item 1] | [X months] | High |
| [Item 2] | [X months] | Medium |
## Resource Requirements
- **Development**: [X hours/week]
- **Testing**: [X hours/week]
- **Code Review**: [X hours/week]
- **Documentation**: [X hours]
## Risks & Dependencies
### Risks
| Risk | Impact | Mitigation |
|------|--------|------------|
| [Risk 1] | High/Med/Low | [Strategy] |
| [Risk 2] | High/Med/Low | [Strategy] |
### Dependencies
- [Dependency 1 - Impact if delayed]
- [Dependency 2 - Impact if delayed]
## Success Metrics
### Technical Metrics
- **Code Quality**: [Current X/10] → [Target Y/10]
- **Test Coverage**: [Current X%] → [Target Y%]
- **Build Time**: [Current Xs] → [Target Ys]
- **Crash-Free Rate**: [Current X%] → [Target Y%]
### User-Facing Metrics
- **App Launch Time**: [Current Xs] → [Target Ys]
- **Screen Load Time**: [Current Xs] → [Target Ys]
- **User Rating**: [Current X.X] → [Target Y.Y]
## Related Documents
- [analysis-report.md](./analysis-report.md) - Full analysis
- [recommendations.md](./recommendations.md) - Detailed recommendations
- [issues.md](./issues.md) - Issues trackerStep 5: Provide Actionable Roadmap
Summarize the created documentation and next steps:
Phase 1: Stabilize (Weeks 1-2)
- Fix critical issues
- Address immediate bugs
- Implement quick wins
Phase 2: Improve (Weeks 3-8)
- Refactor priority areas
- Improve architecture consistency
- Add missing tests
- Update dependencies
Phase 3: Modernize (Months 3-6)
- Architecture migration (if needed)
- Tech stack updates (SwiftUI, etc.)
- Feature enhancements
- Performance optimization
Phase 4: Enhance (Ongoing)
- New features
- Continuous improvement
- Best practices maintenance
Existing App Analysis Tips
Be Thorough but Practical:
- Don't recommend rewriting unless truly necessary
- Prioritize impact vs effort
- Consider team bandwidth
- Balance idealism with pragmatism
Respect Existing Decisions:
- Understand why current choices were made
- Some "anti-patterns" may have valid reasons
- Consider historical context
- Be constructive, not critical
Focus on Value:
- Prioritize user-facing improvements
- Balance technical debt with features
- Quick wins build momentum
- Long-term vision with short-term gains
Consider Migration Paths:
- Incremental over big-bang
- Feature-by-feature migration
- Hybrid approaches during transition
- Risk mitigation strategies
Planning Tips
Ask Questions Early
- Don't assume requirements
- Clarify ambiguous needs
- Understand constraints upfront
- Use AskUserQuestion tool to gather context
Tailor to Project Type
Personal Projects:
- Simpler architecture often better
- Focus on learning and shipping
- Can use latest iOS versions
- Fewer third-party dependencies
Client Projects:
- Document everything
- Consider maintenance burden
- Balance features vs timeline
- Professional testing standards
Startups:
- Ship fast, iterate
- Plan for scale but start simple
- Analytics crucial
- User feedback loops important
Be Pragmatic
- Perfect is enemy of good
- Start simple, refine later
- Don't over-engineer for MVP
- Focus on core value proposition
Think Mobile-First
- Offline-first considerations
- Battery and performance
- Small screen constraints
- Touch interactions
- iOS platform conventions
References
- Swift API Design Guidelines
- iOS Human Interface Guidelines
- App Store Review Guidelines
- architecture-guide.md - Detailed architecture decisions
- tech-stack-options.md - Technology selection guide
- planning-checklist.md - Comprehensive planning checklist
Notes
- Use planning-checklist.md for comprehensive phase-by-phase planning
- Refer to architecture-guide.md for detailed architecture patterns
- Check tech-stack-options.md for technology recommendations
- Always generate the planning document for user reference
- Tailor depth of planning to user's needs and project type
- Use AskUserQuestion to clarify requirements and preferences
iOS App Architecture Guide
Comprehensive guide to iOS architecture patterns, helping you choose the right architecture for your app.
Architecture Pattern Overview
Quick Comparison Table
| Pattern | Complexity | Learning Curve | Best For | Team Size | Testability |
|---|---|---|---|---|---|
| MVVM | Medium | Medium | Most apps | Any | High |
| MVC | Low | Low | Simple apps, prototypes | Solo-Small | Medium |
| TCA | High | High | Complex state, large apps | Medium-Large | Very High |
| VIPER | Very High | High | Enterprise apps | Large | Very High |
| Redux-like | High | Medium-High | Complex state management | Medium-Large | High |
1. MVVM (Model-View-ViewModel)
Recommended for: Most iOS apps
Overview
MVVM is the de facto standard for modern iOS apps, especially with SwiftUI. It provides excellent separation of concerns while remaining practical and maintainable.
Structure
Model
├── Data entities
├── Business logic
└── Data access
View
├── SwiftUI Views (or UIKit views)
├── UI presentation only
└── Binds to ViewModel
ViewModel
├── Presentation logic
├── State management
├── Transforms model data for view
└── Handles user actionsWhen to Use MVVM
✅ Use MVVM when:
- Building a SwiftUI app (natural fit)
- Team is familiar with the pattern
- Need good testability without over-engineering
- App has moderate complexity
- Want balance between simplicity and structure
❌ Avoid MVVM when:
- App is extremely simple (plain MVC sufficient)
- Need complex state coordination (consider TCA)
- Team prefers different established pattern
MVVM Example Structure
// Model
struct Expense {
let id: UUID
let title: String
let amount: Decimal
let date: Date
}
// ViewModel
@MainActor
class ExpenseListViewModel: ObservableObject {
@Published var expenses: [Expense] = []
@Published var isLoading = false
@Published var errorMessage: String?
private let repository: ExpenseRepository
init(repository: ExpenseRepository) {
self.repository = repository
}
func loadExpenses() async {
isLoading = true
defer { isLoading = false }
do {
expenses = try await repository.fetchExpenses()
} catch {
errorMessage = error.localizedDescription
}
}
func deleteExpense(_ expense: Expense) async {
do {
try await repository.delete(expense)
expenses.removeAll { $0.id == expense.id }
} catch {
errorMessage = error.localizedDescription
}
}
}
// View
struct ExpenseListView: View {
@StateObject private var viewModel: ExpenseListViewModel
init(repository: ExpenseRepository) {
_viewModel = StateObject(wrappedValue: ExpenseListViewModel(repository: repository))
}
var body: some View {
List(viewModel.expenses) { expense in
ExpenseRow(expense: expense)
}
.task {
await viewModel.loadExpenses()
}
}
}MVVM Best Practices
- ViewModels should be testable without UI
- Use dependency injection for ViewModels
- Keep Views dumb (minimal logic)
- One ViewModel per screen/feature (usually)
- ViewModels own business logic, Views own UI logic
- Use
@MainActorfor ViewModels with@Publishedproperties
Folder Structure for MVVM
MyApp/
├── Models/
│ ├── Expense.swift
│ └── Category.swift
├── ViewModels/
│ ├── ExpenseListViewModel.swift
│ └── ExpenseDetailViewModel.swift
├── Views/
│ ├── ExpenseListView.swift
│ ├── ExpenseDetailView.swift
│ └── Components/
│ └── ExpenseRow.swift
├── Services/
│ ├── ExpenseRepository.swift
│ └── NetworkService.swift
└── Utilities/
└── Extensions.swift2. MVC (Model-View-Controller)
Recommended for: Simple apps, prototypes, UIKit apps
Overview
The classic pattern, built into UIKit. Despite its "Massive View Controller" reputation, it works well for simple apps when used properly.
Structure
Model
├── Data entities
└── Business logic
View
├── UIView subclasses
└── Display only
Controller
├── UIViewController
├── Coordinates between Model and View
├── Handles user input
└── Often becomes largeWhen to Use MVC
✅ Use MVC when:
- Building a simple app or prototype
- Working primarily with UIKit
- Team is most familiar with MVC
- Rapid development is priority
- App won't grow complex
❌ Avoid MVC when:
- App will be complex/large
- Need high testability
- Using SwiftUI (MVVM is better fit)
- Multiple developers working on same features
MVC Best Practices
- Keep ViewControllers focused (under 300 lines)
- Extract logic into services/managers
- Use child view controllers to break up complexity
- Create reusable UIView components
- Use protocols for delegation
3. TCA (The Composable Architecture)
Recommended for: Large, complex apps with sophisticated state management
Overview
A functional architecture from Point-Free, emphasizing composition, testability, and predictable state management. Inspired by Elm and Redux.
Core Concepts
- State: Single source of truth
- Action: All possible events
- Reducer: Pure function that evolves state
- Effect: Side effects (network, database, etc.)
- Store: Holds state and processes actions
When to Use TCA
✅ Use TCA when:
- Building a large, complex app
- Need predictable state management
- Want comprehensive testing
- Team is experienced or willing to learn
- Complex state coordination between features
- Want time-travel debugging
❌ Avoid TCA when:
- Building simple apps (overkill)
- Team unfamiliar and on tight timeline
- Need rapid prototyping
- Team size is very small
TCA Example Structure
import ComposableArchitecture
// State
struct ExpenseListState: Equatable {
var expenses: [Expense] = []
var isLoading = false
var errorMessage: String?
}
// Action
enum ExpenseListAction: Equatable {
case loadExpenses
case expensesLoaded(TaskResult<[Expense]>)
case deleteExpense(Expense)
case expenseDeleted(TaskResult<Void>)
}
// Environment (Dependencies)
struct ExpenseListEnvironment {
var expenseRepository: ExpenseRepository
}
// Reducer
let expenseListReducer = Reducer<
ExpenseListState,
ExpenseListAction,
ExpenseListEnvironment
> { state, action, environment in
switch action {
case .loadExpenses:
state.isLoading = true
return environment.expenseRepository
.fetchExpenses()
.catchToEffect(ExpenseListAction.expensesLoaded)
case .expensesLoaded(.success(let expenses)):
state.isLoading = false
state.expenses = expenses
return .none
case .expensesLoaded(.failure(let error)):
state.isLoading = false
state.errorMessage = error.localizedDescription
return .none
case .deleteExpense(let expense):
return environment.expenseRepository
.delete(expense)
.catchToEffect { .expenseDeleted($0) }
case .expenseDeleted(.success):
return .none
case .expenseDeleted(.failure(let error)):
state.errorMessage = error.localizedDescription
return .none
}
}
// View
struct ExpenseListView: View {
let store: Store<ExpenseListState, ExpenseListAction>
var body: some View {
WithViewStore(store) { viewStore in
List(viewStore.expenses) { expense in
ExpenseRow(expense: expense)
}
.task {
viewStore.send(.loadExpenses)
}
}
}
}TCA Best Practices
- Keep reducers pure (no side effects)
- Use dependencies for testability
- Compose features with reducer composition
- Leverage exhaustive testing
- Use
@Dependencyfor dependencies
Resources for TCA
4. VIPER
Recommended for: Enterprise apps, large teams
Overview
Highly modular pattern that separates concerns into five components. Provides excellent testability and separation but adds significant complexity.
Structure
View
├── Displays data
└── Minimal logic
Interactor
├── Business logic
└── Data operations
Presenter
├── Formats data for view
└── Handles view logic
Entity
├── Data models
└── Plain structs
Router
├── Navigation logic
└── Screen transitionsWhen to Use VIPER
✅ Use VIPER when:
- Building enterprise-scale apps
- Large team working on same codebase
- Maximum testability required
- Clear separation of responsibilities critical
- Long-term maintenance expected
❌ Avoid VIPER when:
- Small to medium apps
- Solo developer or small team
- Rapid development needed
- Team unfamiliar with pattern
VIPER Considerations
- High boilerplate (5 files per screen)
- Steep learning curve
- Slower initial development
- Excellent for large, long-lived apps
- Overkill for most apps
5. Redux-like / Flux
Recommended for: Apps needing centralized state management
Overview
Unidirectional data flow with centralized state store. Similar to TCA but more lightweight.
Core Concepts
- Single state tree
- Actions dispatched to change state
- Reducers handle state changes
- Middleware for side effects
When to Use Redux-like
✅ Use when:
- Need centralized state management
- Want predictable state updates
- Complex state coordination
- Time-travel debugging desired
- Team familiar with Redux
❌ Avoid when:
- Simple local state sufficient
- Team unfamiliar with pattern
- Prefer less boilerplate
Popular Swift Redux Libraries
- ReSwift
- SwiftRex
- Suas
Architecture Decision Framework
Step 1: Assess Your Project
Project Size:
- Small (<10 screens): MVC or MVVM
- Medium (10-30 screens): MVVM
- Large (30+ screens): MVVM or TCA
- Enterprise: VIPER or TCA
Team Size:
- Solo: MVVM or MVC
- 2-5 developers: MVVM
- 5-10 developers: MVVM or TCA
- 10+ developers: TCA or VIPER
Complexity:
- Simple CRUD: MVC or MVVM
- Moderate business logic: MVVM
- Complex state management: TCA
- Complex business rules: VIPER or TCA
Step 2: Consider Constraints
Timeline:
- Tight deadline: MVC or MVVM
- Standard timeline: MVVM
- Long-term project: Any
Team Experience:
- Junior team: MVC or MVVM
- Mixed experience: MVVM
- Senior team: Any
UI Framework:
- SwiftUI: MVVM or TCA (best fits)
- UIKit: Any (MVC is native)
- Hybrid: MVVM (most flexible)
Step 3: Choose Architecture
Based on the assessment, follow this decision tree:
Is the app simple (<10 screens, basic features)?
├─ Yes → Use MVC or MVVM
└─ No → Continue
Does the app have complex state management needs?
├─ Yes → Use TCA or Redux-like
└─ No → Continue
Is the team large (10+ developers)?
├─ Yes → Use VIPER or TCA
└─ No → Continue
Using SwiftUI?
├─ Yes → Use MVVM
└─ No (UIKit) → Use MVC or MVVM
Default: MVVM (best balance for most apps)Hybrid Approaches
MVVM + Coordinators
Adds navigation coordination to MVVM:
- ViewModels focus on presentation logic
- Coordinators handle navigation flow
- Better separation of concerns
- Good for medium-large apps
Clean Architecture + MVVM
Adds layer separation to MVVM:
- Domain layer (business logic)
- Data layer (repositories, APIs)
- Presentation layer (MVVM)
- Enterprise-grade separation
Common Pitfalls
❌ Over-Engineering
Problem: Using VIPER for a simple to-do app Solution: Match architecture to actual complexity
❌ Under-Engineering
Problem: Large app with no architecture Solution: Introduce structure early, refactor if needed
❌ Mixing Patterns
Problem: MVVM + MVC + VIPER in same codebase Solution: Choose one pattern and stick to it
❌ Ignoring Team
Problem: Using TCA when team is unfamiliar Solution: Consider team experience and learning curve
❌ Architecture Astronauting
Problem: Creating custom architecture "better than all others" Solution: Use proven patterns, customize minimally
Migration Strategies
From MVC to MVVM
1. Start with new features in MVVM 2. Gradually extract logic from ViewControllers 3. Create ViewModels for existing screens 4. Refactor incrementally
From MVVM to TCA
1. Identify complex state management areas 2. Migrate feature-by-feature 3. Use MVVM/TCA hybrid during transition 4. Complete migration when team comfortable
Recommendations by App Type
Personal Productivity App
Recommended: MVVM Rationale: Good balance, excellent SwiftUI support
Social Media App
Recommended: TCA or MVVM+Coordinators Rationale: Complex state, many navigation flows
E-Commerce App
Recommended: MVVM or TCA Rationale: Moderate complexity, good testability needed
Enterprise B2B App
Recommended: VIPER or TCA Rationale: Large codebase, multiple teams, high testability
Game/Entertainment App
Recommended: MVC or custom Rationale: Different patterns often needed
Utility/Tool App
Recommended: MVVM Rationale: Simple, focused, good structure
Testing Considerations
MVVM Testing
@MainActor
final class ExpenseListViewModelTests: XCTestCase {
func testLoadExpenses() async {
let mockRepo = MockExpenseRepository()
mockRepo.expenses = [Expense(id: UUID(), title: "Test", amount: 10, date: Date())]
let viewModel = ExpenseListViewModel(repository: mockRepo)
await viewModel.loadExpenses()
XCTAssertEqual(viewModel.expenses.count, 1)
XCTAssertFalse(viewModel.isLoading)
}
}TCA Testing
@MainActor
final class ExpenseListTests: XCTestCase {
func testLoadExpenses() async {
let store = TestStore(
initialState: ExpenseListState(),
reducer: expenseListReducer,
environment: .mock
)
await store.send(.loadExpenses) {
$0.isLoading = true
}
await store.receive(.expensesLoaded(.success([...]))) {
$0.isLoading = false
$0.expenses = [...]
}
}
}Resources
Books
Online Resources
Apple Documentation
Summary
For most iOS apps: Use MVVM
- Proven pattern
- Excellent SwiftUI support
- Good testability
- Manageable complexity
- Strong community support
Use TCA when:
- Complex state management
- Large app
- Experienced team
- Need predictable state
Use MVC when:
- Simple app
- Rapid prototype
- UIKit-focused
Use VIPER when:
- Enterprise scale
- Large team
- Maximum separation needed
Default recommendation: Start with MVVM, evaluate if needs change
Comprehensive App Planning Checklist
Complete checklist for iOS/Swift app planning covering all phases from concept to distribution, plus existing app audit checklist.
---
Existing App Audit Checklist
Use this section when analyzing an existing iOS app. For new apps, skip to "Phase 1: Product Planning" below.
Discovery & Understanding
Codebase Structure
- [ ] Identify project organization (by feature, by layer, by module)
- [ ] Count total Swift files
- [ ] Identify number of screens/features
- [ ] Locate main entry points (App/SceneDelegate)
- [ ] Find configuration files (Info.plist, xcconfig)
- [ ] Check for documentation (README, inline docs)
Tech Stack Detection
- [ ] UI Framework: Determine SwiftUI vs UIKit vs Hybrid
- [ ] iOS Deployment Target: Check minimum iOS version
- [ ] Architecture Pattern: Identify MVVM, MVC, TCA, VIPER, or mixed
- [ ] Persistence: Detect Core Data, SwiftData, Realm, UserDefaults, or other
- [ ] Networking: Identify URLSession, Alamofire, or custom implementation
- [ ] Dependency Management: Check for SPM (Package.swift), CocoaPods (Podfile), Carthage
- [ ] Third-Party Dependencies: List all external libraries
- [ ] Testing Framework: Check for XCTest, Quick/Nimble, or other
Architecture Analysis
Pattern Consistency
- [ ] Architecture pattern used consistently across features
- [ ] Clear separation of concerns (Model/View/ViewModel or equivalent)
- [ ] Business logic properly separated from UI
- [ ] Data layer properly abstracted
- [ ] No massive view controllers (files >500 lines)
Code Organization
- [ ] Logical folder structure
- [ ] Related code grouped together
- [ ] Clear naming conventions followed
- [ ] Appropriate use of MARK comments
- [ ] Extensions organized logically
Architecture Quality Rating
- [ ] Rate overall architecture (1-10)
- [ ] Note major architecture issues
- [ ] Identify inconsistencies
- [ ] Document mixed patterns
Tech Stack Evaluation
UI Framework Assessment
- [ ] SwiftUI/UIKit choice appropriate for requirements
- [ ] If hybrid, transition strategy is clear
- [ ] UI framework usage is consistent
- [ ] No unnecessary framework mixing
Dependency Health
- [ ] All dependencies actively maintained
- [ ] No deprecated dependencies
- [ ] Dependencies are up to date
- [ ] No conflicting dependencies
- [ ] Dependency count is reasonable (<10 recommended)
- [ ] Each dependency has clear purpose
iOS Version Support
- [ ] Deployment target is appropriate
- [ ] Not supporting unnecessarily old iOS versions
- [ ] Using modern APIs where possible
- [ ] Not missing features due to low deployment target
Code Quality Assessment
File Size Analysis
- [ ] Identify files over 300 lines
- [ ] Note files over 500 lines (refactoring candidates)
- [ ] Check for massive files (>1000 lines - urgent refactoring)
- [ ] Average file size is reasonable
Code Quality Checks
- [ ] Consistent naming conventions
- [ ] No force unwrapping (!) without good reason
- [ ] Proper optional handling (guard, if let, ??)
- [ ] No retain cycles (weak self in closures)
- [ ] Proper error handling (not silent try?)
- [ ] Comments where needed (not excessive)
- [ ] No commented-out code
- [ ] No TODO/FIXME without tracking
Code Duplication
- [ ] Check for repeated code patterns
- [ ] Identify opportunities for extraction
- [ ] Note copy-pasted code
- [ ] Identify missing abstractions
Feature Analysis
Current Features
- [ ] List all major features
- [ ] Document feature completeness
- [ ] Identify half-implemented features
- [ ] Note feature quality issues
Feature Organization
- [ ] Features logically organized
- [ ] Feature code is cohesive
- [ ] Features properly separated
- [ ] Shared code properly extracted
Missing or Incomplete
- [ ] Identify missing critical features
- [ ] Note incomplete implementations
- [ ] Document feature gaps
- [ ] Identify user pain points
Performance & Best Practices
SwiftUI Patterns (if applicable)
- [ ] Proper @State, @StateObject, @ObservedObject usage
- [ ] No heavy computation in body
- [ ] Views broken into components
- [ ] Single source of truth maintained
- [ ] No ViewModels created in body
UIKit Patterns (if applicable)
- [ ] Proper view controller lifecycle
- [ ] No view logic in controllers
- [ ] Reusable views extracted
- [ ] Proper delegation patterns
Core Data Usage (if applicable)
- [ ] Using appropriate context (viewContext, background)
- [ ] Checking hasChanges before save
- [ ] Proper error handling on saves
- [ ] Efficient fetch requests
- [ ] No NSFetchRequest in loops
- [ ] Proper relationship handling
Memory Management
- [ ] Check for [weak self] in closures
- [ ] Delegates marked as weak
- [ ] No obvious retain cycles
- [ ] Proper deinit for cleanup
Error Handling
- [ ] Consistent error handling approach
- [ ] User-facing error messages
- [ ] Not swallowing errors silently (try?)
- [ ] Logging errors appropriately
UI/UX Assessment
HIG Compliance (Basic Check)
- [ ] Standard navigation patterns used
- [ ] Appropriate spacing and layout
- [ ] Consistent visual design
- [ ] Platform-appropriate controls
Accessibility
- [ ] VoiceOver labels present
- [ ] Dynamic Type support
- [ ] Color contrast adequate
- [ ] Accessibility traits set
- [ ] Accessibility tested
Navigation
- [ ] Clear navigation hierarchy
- [ ] Navigation pattern is consistent
- [ ] Back navigation works correctly
- [ ] Deep linking (if applicable)
Design Consistency
- [ ] Consistent color usage
- [ ] Consistent typography
- [ ] Consistent spacing
- [ ] Reusable UI components
Testing
Test Coverage
- [ ] Unit tests exist
- [ ] Estimate test coverage (%)
- [ ] Critical paths tested
- [ ] ViewModels tested
- [ ] Business logic tested
Test Quality
- [ ] Tests are meaningful
- [ ] Tests are maintainable
- [ ] Tests run reliably
- [ ] No flaky tests
- [ ] Good test organization
Testing Gaps
- [ ] Identify untested critical code
- [ ] Note missing test categories
- [ ] Assess risk of low coverage
Security & Privacy
Security Checks
- [ ] No hardcoded secrets/API keys
- [ ] Sensitive data in Keychain
- [ ] HTTPS for all connections
- [ ] Proper authentication handling
- [ ] Input validation present
Privacy
- [ ] Privacy policy exists (if needed)
- [ ] Proper permission requests
- [ ] User data handled correctly
- [ ] No unnecessary data collection
Distribution & Deployment
App Store Presence
- [ ] App Store listing complete
- [ ] App screenshots current
- [ ] App description accurate
- [ ] Version number scheme
- [ ] Release notes maintained
Build Configuration
- [ ] Proper build configurations (Debug/Release)
- [ ] Code signing setup correctly
- [ ] No debug code in release builds
- [ ] Build optimization enabled
Issues Prioritization
Critical Issues (Must Fix)
- [ ] List critical bugs
- [ ] Note security vulnerabilities
- [ ] Document crashes
- [ ] Identify data loss risks
High Priority (Should Fix Soon)
- [ ] Architecture problems
- [ ] Major performance issues
- [ ] Serious technical debt
- [ ] User experience problems
Medium Priority (Plan to Fix)
- [ ] Code quality issues
- [ ] Minor performance issues
- [ ] Missing best practices
- [ ] Maintainability concerns
Low Priority (Nice to Have)
- [ ] Code style improvements
- [ ] Minor optimizations
- [ ] Documentation improvements
Analysis Summary
Overall Assessment
- [ ] Overall app health rating (Excellent/Good/Fair/Needs Work)
- [ ] Top 3 strengths
- [ ] Top 3 concerns
- [ ] Biggest risk
- [ ] Biggest opportunity
Recommendations Summary
- [ ] Immediate actions (this week)
- [ ] Short-term improvements (1-2 months)
- [ ] Long-term strategy (3-6 months)
- [ ] Tech stack changes (if any)
- [ ] Architecture changes (if any)
Effort Estimates
- [ ] Quick wins identified (1-2 weeks)
- [ ] Medium efforts listed (1-2 months)
- [ ] Large efforts noted (3-6 months)
- [ ] Total estimated effort for main improvements
---
NEW APP PLANNING
Use the sections below when planning a new iOS app from scratch.
Phase 1: Product Planning
App Concept
- [ ] Define core problem the app solves
- [ ] Identify unique value proposition
- [ ] Research competing apps (if applicable)
- [ ] Define success criteria
Target Audience
- [ ] Identify primary user demographic
- [ ] Define user goals and pain points
- [ ] Create 1-2 user personas (if helpful)
- [ ] Understand user context (where, when, why they'll use the app)
Feature Planning
- [ ] List all potential features
- [ ] Categorize features (MVP, v2, Future)
- [ ] Prioritize MVP features by value
- [ ] Estimate complexity for each feature
- [ ] Define feature dependencies
- [ ] Identify potential scope creep risks
User Experience Planning
- [ ] Map primary user journeys
- [ ] Identify key touchpoints
- [ ] Define success metrics per journey
- [ ] Plan for edge cases and errors
- [ ] Consider first-time user experience
- [ ] Plan returning user experience
Phase 2: Technical Planning
Architecture Decisions
- [ ] Choose architecture pattern (MVVM, TCA, VIPER, MVC)
- [ ] Document architecture decision rationale
- [ ] Plan for testability
- [ ] Consider team experience with pattern
- [ ] Evaluate scalability needs
Data Modeling
- [ ] Identify main entities
- [ ] Define entity relationships
- [ ] Plan data flow (source → storage → display)
- [ ] Consider data migration needs
- [ ] Plan for data validation
- [ ] Define data retention policies
Persistence Layer
- [ ] Choose storage solution:
- [ ] Core Data (complex data, relationships)
- [ ] SwiftData (iOS 17+, modern approach)
- [ ] UserDefaults (simple settings)
- [ ] Realm (alternative to Core Data)
- [ ] File system (documents, cache)
- [ ] Keychain (sensitive data)
- [ ] Plan offline capabilities
- [ ] Design sync strategy (if cloud sync needed)
- [ ] Plan data backup/restore
Tech Stack Selection
- [ ] UI Framework:
- [ ] SwiftUI (modern, declarative)
- [ ] UIKit (mature, more control)
- [ ] Hybrid approach
- [ ] Minimum iOS version:
- [ ] Consider feature requirements
- [ ] Check target audience device stats
- [ ] Balance new features vs user reach
- [ ] Networking layer:
- [ ] URLSession (native, sufficient for most)
- [ ] Alamofire (convenience, community)
- [ ] Custom wrapper
- [ ] Dependency management:
- [ ] Swift Package Manager (recommended)
- [ ] CocoaPods
- [ ] Carthage
- [ ] Manual
- [ ] Third-party libraries (evaluate each):
- [ ] Authentication (if needed)
- [ ] Analytics
- [ ] Crash reporting
- [ ] Image loading/caching
- [ ] UI components
- [ ] Utility libraries
Project Structure
- [ ] Define folder organization:
- [ ] By feature (recommended for medium+ apps)
- [ ] By layer (Model, View, ViewModel)
- [ ] By module (for large apps)
- [ ] Plan file naming conventions
- [ ] Define code organization standards
- [ ] Plan for shared/common code
- [ ] Consider modularization needs
Backend & APIs
- [ ] Define API requirements
- [ ] Choose backend approach:
- [ ] Custom backend
- [ ] BaaS (Firebase, Supabase, etc.)
- [ ] CloudKit
- [ ] No backend needed
- [ ] Define API contracts
- [ ] Plan API versioning strategy
- [ ] Design error handling for network issues
- [ ] Plan for API rate limiting
Phase 3: UI/UX Planning
Design System
- [ ] Color Palette:
- [ ] Primary colors
- [ ] Secondary colors
- [ ] Semantic colors (success, error, warning)
- [ ] Light mode palette
- [ ] Dark mode palette
- [ ] Verify WCAG contrast ratios
- [ ] Typography:
- [ ] Font selection (SF Pro, custom)
- [ ] Text styles hierarchy
- [ ] Dynamic Type support plan
- [ ] Minimum/maximum font sizes
- [ ] Spacing System:
- [ ] Base unit (8pt recommended)
- [ ] Spacing scale (8, 16, 24, 32, etc.)
- [ ] Consistent padding/margins
- [ ] Component Library:
- [ ] List reusable components
- [ ] Define component states
- [ ] Plan component customization
Navigation Architecture
- [ ] Choose primary navigation pattern:
- [ ] Tab Bar (2-5 main sections)
- [ ] Sidebar (iPad, complex hierarchies)
- [ ] Navigation Stack (linear flows)
- [ ] Custom navigation
- [ ] Map navigation hierarchy
- [ ] Plan deep linking structure
- [ ] Define modal/sheet presentation rules
- [ ] Plan navigation state preservation
Screen Planning
- [ ] List all screens/views
- [ ] Create screen hierarchy diagram
- [ ] Define screen relationships
- [ ] Plan screen transitions
- [ ] Design empty states for each screen
- [ ] Design loading states
- [ ] Design error states
- [ ] Plan pull-to-refresh patterns
Accessibility Planning
- [ ] Dynamic Type:
- [ ] Use system text styles
- [ ] Test at all accessibility sizes
- [ ] Ensure layout adapts
- [ ] VoiceOver:
- [ ] Plan accessibility labels
- [ ] Define accessibility hints
- [ ] Set accessibility traits
- [ ] Plan focus order
- [ ] Other Accessibility:
- [ ] Color contrast compliance
- [ ] Reduce motion support
- [ ] Large content viewer support
- [ ] Switch control compatibility
- [ ] Voice control support
Responsive Design
- [ ] Plan for different iPhone sizes
- [ ] Design for iPad (if supporting)
- [ ] Plan landscape orientations
- [ ] Test on smallest supported device
- [ ] Consider Dynamic Island (iPhone 14 Pro+)
- [ ] Plan for safe area insets
Onboarding & Education
- [ ] Design first launch experience
- [ ] Plan permission requests (timing and rationale)
- [ ] Create educational moments
- [ ] Design tutorial/walkthrough (if needed)
- [ ] Plan skip options
Phase 4: Non-Functional Requirements
Performance Requirements
- [ ] Define target devices:
- [ ] iPhone only
- [ ] iPhone + iPad
- [ ] Mac Catalyst
- [ ] Apple Watch
- [ ] Set performance benchmarks:
- [ ] App launch time target
- [ ] Screen load time targets
- [ ] Animation frame rate (60fps)
- [ ] API response time tolerance
- [ ] Plan memory management strategy
- [ ] Consider battery usage optimization
- [ ] Plan app size target
Security & Privacy
- [ ] Authentication (if needed):
- [ ] Choose method (OAuth, Sign in with Apple, email, etc.)
- [ ] Plan session management
- [ ] Implement biometric auth option
- [ ] Design password requirements
- [ ] Data Protection:
- [ ] Identify sensitive data
- [ ] Plan encryption at rest
- [ ] Plan encryption in transit (HTTPS)
- [ ] Use Keychain for credentials
- [ ] Plan for data deletion
- [ ] Privacy Compliance:
- [ ] Create privacy policy
- [ ] Plan privacy nutrition label
- [ ] Implement GDPR/CCPA if applicable
- [ ] Plan user data export
- [ ] Plan user data deletion
- [ ] App Transport Security:
- [ ] Ensure all connections use HTTPS
- [ ] Document any ATS exceptions
Testing Strategy
- [ ] Unit Testing:
- [ ] Define coverage goal (70%+ recommended)
- [ ] Identify critical paths to test
- [ ] Plan test data management
- [ ] Choose testing framework (XCTest)
- [ ] UI Testing:
- [ ] Identify key user flows to test
- [ ] Plan UI test maintenance strategy
- [ ] Consider snapshot testing
- [ ] Integration Testing:
- [ ] Plan API integration tests
- [ ] Test data layer
- [ ] Test third-party integrations
- [ ] Manual Testing:
- [ ] Create test plans
- [ ] Plan device testing matrix
- [ ] Beta testing approach
- [ ] Accessibility Testing:
- [ ] Test with VoiceOver
- [ ] Test with Dynamic Type
- [ ] Use Accessibility Inspector
Analytics & Monitoring
- [ ] Analytics:
- [ ] Choose analytics tool
- [ ] Define key events to track
- [ ] Plan user property tracking
- [ ] Ensure privacy compliance
- [ ] Plan funnel analysis
- [ ] Crash Reporting:
- [ ] Choose crash reporting tool
- [ ] Plan symbolication process
- [ ] Define crash severity levels
- [ ] Set up alert thresholds
- [ ] Performance Monitoring:
- [ ] Monitor app start time
- [ ] Track screen load times
- [ ] Monitor memory usage
- [ ] Track network performance
- [ ] User Feedback:
- [ ] Plan in-app feedback mechanism
- [ ] Monitor App Store reviews
- [ ] Plan feature request tracking
Localization & Internationalization
- [ ] Plan initial language(s)
- [ ] Use NSLocalizedString for all text
- [ ] Avoid hardcoded strings
- [ ] Plan for RTL languages (if applicable)
- [ ] Consider number/date formatting
- [ ] Plan for text expansion
- [ ] Test with pseudo-localization
Phase 5: Distribution & Business
App Store Preparation
- [ ] App Metadata:
- [ ] Choose app name
- [ ] Check name availability
- [ ] Write app description
- [ ] Select app category
- [ ] Define keywords
- [ ] Choose age rating
- [ ] Bundle Identifier:
- [ ] Choose bundle ID (com.company.appname)
- [ ] Register bundle ID in Apple Developer
- [ ] Plan for extensions/widgets
- [ ] Screenshots & Media:
- [ ] Plan screenshot strategy
- [ ] Design promotional images
- [ ] Plan app preview video (optional)
- [ ] Create app icon (required sizes)
- [ ] App Store Listing:
- [ ] Write promotional text
- [ ] Plan what's new descriptions
- [ ] Design marketing assets
Monetization (if applicable)
- [ ] Choose business model:
- [ ] Free (with limitations/ads)
- [ ] Paid (one-time purchase)
- [ ] Freemium (IAP to unlock)
- [ ] Subscription
- [ ] In-App Purchases (if using):
- [ ] Define IAP products
- [ ] Set pricing tiers
- [ ] Plan purchase flow UX
- [ ] Implement StoreKit
- [ ] Plan receipt validation
- [ ] Subscriptions (if using):
- [ ] Define subscription tiers
- [ ] Plan free trial period
- [ ] Design subscription management UI
- [ ] Plan renewal reminders
- [ ] Ads (if using):
- [ ] Choose ad network
- [ ] Plan ad placement
- [ ] Ensure non-intrusive
- [ ] Plan ad-free option
Legal & Compliance
- [ ] Create Terms of Service
- [ ] Create Privacy Policy
- [ ] Review App Store Review Guidelines
- [ ] Check for restricted content
- [ ] Plan for content moderation (if UGC)
- [ ] Consider COPPA compliance (if children's app)
Timeline & Milestones
- [ ] Define MVP scope
- [ ] Estimate MVP timeline
- [ ] Plan sprint/iteration schedule
- [ ] Set feature freeze date
- [ ] Plan testing period
- [ ] Set submission target date
- [ ] Plan post-launch support
Version Planning
- [ ] Define v1.0 scope
- [ ] Plan v1.1+ features
- [ ] Plan major version milestones (2.0, etc.)
- [ ] Define versioning strategy
- [ ] Plan deprecation policy
- [ ] Consider backward compatibility
Launch Planning
- [ ] Plan soft launch strategy
- [ ] Define launch marketing
- [ ] Prepare support resources
- [ ] Plan social media presence
- [ ] Set up website/landing page
- [ ] Plan beta testing program
- [ ] Define success metrics
Phase 6: Development Setup
Xcode Project Setup
- [ ] Create new Xcode project
- [ ] Configure project settings
- [ ] Set deployment target
- [ ] Add app icon
- [ ] Configure signing & capabilities
- [ ] Set up schemes (Debug, Release)
- [ ] Configure build configurations
Version Control
- [ ] Initialize git repository
- [ ] Create .gitignore
- [ ] Define branching strategy
- [ ] Set up remote repository (GitHub, etc.)
- [ ] Plan commit conventions
- [ ] Set up pull request process
CI/CD
- [ ] Choose CI/CD platform (GitHub Actions, Xcode Cloud, etc.)
- [ ] Set up automated builds
- [ ] Configure automated tests
- [ ] Plan automated deployment
- [ ] Set up TestFlight automation
- [ ] Configure code signing for CI
Development Environment
- [ ] Document required tools
- [ ] Set up linting (SwiftLint)
- [ ] Configure code formatting
- [ ] Set up code review process
- [ ] Plan pair programming (if team)
- [ ] Set up development documentation
Quick Validation Checklist
Use this for quick planning validation:
Must Have
- [ ] Clear app purpose defined
- [ ] Target users identified
- [ ] MVP features prioritized
- [ ] Architecture pattern chosen
- [ ] Data model designed
- [ ] Tech stack selected
- [ ] Primary navigation planned
- [ ] Privacy policy created
Should Have
- [ ] User personas created
- [ ] Design system defined
- [ ] Accessibility planned
- [ ] Testing strategy defined
- [ ] Analytics planned
- [ ] Timeline estimated
- [ ] App Store metadata prepared
Nice to Have
- [ ] Detailed wireframes
- [ ] Complete UI specifications
- [ ] Comprehensive test plans
- [ ] Marketing strategy
- [ ] Beta testing program
- [ ] Launch plan
References
iOS Tech Stack Options Guide
Comprehensive guide to technology choices for iOS app development, helping you select the right tools and frameworks.
UI Framework Selection
SwiftUI vs UIKit
| Aspect | SwiftUI | UIKit |
|---|---|---|
| Minimum iOS | iOS 13+ (iOS 15+ recommended) | iOS 2+ |
| Learning Curve | Medium (declarative paradigm) | Medium-High (imperative) |
| Maturity | Young (2019+) | Mature (2008+) |
| Performance | Excellent (optimized) | Excellent |
| Customization | Good (improving) | Excellent |
| Community | Growing | Extensive |
| Future | Apple's focus | Maintained |
When to Use SwiftUI
✅ Use SwiftUI when:
- Targeting iOS 15+ (or iOS 14+ minimum)
- Starting a new project
- Want rapid UI development
- Prefer declarative syntax
- Building for multiple Apple platforms
- Standard UI components sufficient
Strengths:
- Declarative, intuitive syntax
- Live previews speed development
- Built-in dark mode support
- Excellent multi-platform support
- Less code for common UIs
- Native animations
Limitations:
- Some advanced UIKit features not available
- Harder to integrate with legacy code
- iOS version requirements
- Still evolving (breaking changes possible)
When to Use UIKit
✅ Use UIKit when:
- Need to support iOS 12 or earlier
- Require advanced customization
- Have existing UIKit codebase
- Need specific UIKit-only features
- Team more experienced with UIKit
Strengths:
- Mature, stable API
- Extensive customization options
- Larger community/resources
- Support for older iOS versions
- More third-party library support
- Fine-grained control
Limitations:
- More verbose code
- Manual dark mode implementation
- Imperative (more complex)
- Storyboards can be cumbersome
Hybrid Approach
✅ Use Hybrid when:
- Migrating UIKit app to SwiftUI
- Need best of both worlds
- Some features only in UIKit/SwiftUI
Integration:
// UIKit in SwiftUI
UIViewRepresentable / UIViewControllerRepresentable
// SwiftUI in UIKit
UIHostingControllerRecommendation by Project Type
| Project Type | Recommendation | Rationale |
|---|---|---|
| New app (iOS 15+) | SwiftUI | Modern, future-proof |
| New app (iOS 13-14) | SwiftUI (with caution) | Consider UIKit for complex UIs |
| Legacy app | Hybrid | Gradual migration |
| Complex custom UI | UIKit or Hybrid | More control needed |
| Multi-platform | SwiftUI | Better multi-platform support |
Minimum iOS Version
iOS Version Support Strategy
| Version | Release | Market Share (approx) | Recommendation |
|---|---|---|---|
| iOS 18 | 2024 | Growing | Cutting edge only |
| iOS 17 | 2023 | Moderate | Modern apps |
| iOS 16 | 2022 | High | Good balance |
| iOS 15 | 2021 | Very High | Recommended minimum |
| iOS 14 | 2020 | Near universal | Safe minimum |
| iOS 13 | 2019 | Near universal | Only if needed |
Decision Framework
Factors to Consider: 1. Target Audience Device Age
- Consumer apps: iOS 15+ (reach most users)
- Enterprise apps: Check company policy
- Education: May need older support
2. Required Features
- iOS 17: TipKit, Observation framework
- iOS 16: Charts, NavigationStack
- iOS 15: async/await, improved SwiftUI
- iOS 14: First stable SwiftUI
3. Development Speed
- Newer iOS = more features = faster development
- Older iOS = more workarounds = slower development
Recommendations
Personal Projects:
- Minimum: iOS 16 or 17
- Use latest features for learning
Client/Commercial Apps:
- Minimum: iOS 15 (good balance)
- Check client requirements
Enterprise Apps:
- Check company device policy
- Often iOS 15 or 16
General Rule:
- Support last 2-3 major versions
- iOS N-2 is usually safe (e.g., iOS 16 in 2024)
Persistence Layer
Core Data
Best for: Complex data models, relationships, offline-first apps
Strengths:
- Mature, battle-tested
- Object graph management
- Excellent relationship handling
- CloudKit sync built-in
- Powerful querying (NSPredicate)
- Migration support
Limitations:
- Steep learning curve
- Boilerplate code
- Not thread-safe (context management needed)
✅ Use Core Data when:
- Complex data relationships
- Need CloudKit sync
- Large datasets with performance needs
- Offline-first architecture
- iOS 13+ support
SwiftData
Best for: Modern apps (iOS 17+) needing simple persistence
Strengths:
- Modern Swift-first API
- Less boilerplate than Core Data
- Type-safe queries
- SwiftUI integration
- Built on Core Data
Limitations:
- iOS 17+ only
- Newer (less mature)
- Smaller community
✅ Use SwiftData when:
- Targeting iOS 17+
- Want modern persistence
- Building new app
- SwiftUI-first development
Realm
Best for: Alternative to Core Data with easier API
Strengths:
- Easier than Core Data
- Cross-platform (iOS, Android)
- Live objects (auto-updating)
- Good performance
- Rich query API
Limitations:
- Third-party dependency
- Larger app size
- Migration can be tricky
✅ Use Realm when:
- Want easier API than Core Data
- Cross-platform data sharing
- Don't need CloudKit sync
- Prefer third-party solution
UserDefaults
Best for: Simple settings and preferences
Strengths:
- Extremely simple API
- Built-in
- Synchronizes automatically
Limitations:
- Not for large data
- Not for complex data
- Not encrypted (without extra work)
✅ Use UserDefaults when:
- Storing simple settings
- User preferences
- Small amounts of data (<1MB)
Never use for: Sensitive data, large datasets, complex objects
File System (Documents/Caches)
Best for: Files, images, documents
Strengths:
- Direct control
- Good for large files
- Standard approach for documents
Limitations:
- Manual management
- No querying
✅ Use File System when:
- Storing documents/images
- Large files
- User-generated content
Keychain
Best for: Sensitive data (passwords, tokens)
Strengths:
- Encrypted
- Secure
- Persists across app deletions
- Shared between apps (if configured)
Limitations:
- Small data only
- Slightly complex API
✅ Use Keychain when:
- Storing passwords
- API tokens
- Encryption keys
- Any sensitive data
Cloud Sync Options
| Solution | Best For | Cost | Complexity |
|---|---|---|---|
| CloudKit | Apple ecosystem apps | Free (generous limits) | Medium |
| Firebase | Cross-platform apps | Free tier, then paid | Low |
| Custom Backend | Full control needed | Variable | High |
Persistence Recommendations
| Use Case | Recommendation |
|---|---|
| Simple settings | UserDefaults |
| User credentials | Keychain |
| Complex data (iOS 13-16) | Core Data |
| Complex data (iOS 17+) | SwiftData |
| Files/images | File System |
| Easier alternative to Core Data | Realm |
| Need CloudKit sync | Core Data + CloudKit |
Networking Layer
URLSession (Native)
Strengths:
- Built-in (no dependencies)
- Modern async/await support
- Sufficient for most apps
- Well-documented
Limitations:
- More verbose than alternatives
- Basic error handling
✅ Use URLSession when:
- Simple REST API
- Want zero dependencies
- Standard networking needs
Example:
let (data, response) = try await URLSession.shared.data(from: url)Alamofire
Strengths:
- Cleaner API
- Advanced features (retry, authentication)
- Large community
- Good documentation
Limitations:
- Third-party dependency
- Adds app size
✅ Use Alamofire when:
- Complex networking needs
- Want convenience methods
- Need advanced features
- Team familiar with it
Moya
Strengths:
- Type-safe networking
- Protocol-oriented
- Built on Alamofire
- Good for large apps
Limitations:
- More boilerplate
- Learning curve
- Third-party dependency
✅ Use Moya when:
- Large app with many endpoints
- Want type safety
- Prefer protocol-oriented approach
Custom Wrapper
Strengths:
- Tailored to your needs
- Full control
- Can use URLSession underneath
Limitations:
- Development time
- Maintenance burden
✅ Use Custom when:
- Specific requirements
- Want thin abstraction over URLSession
- Educational purposes
Networking Recommendations
| Project Size | Recommendation |
|---|---|
| Small-Medium | URLSession (native) |
| Medium-Large | Alamofire or Custom |
| Enterprise | Moya or Custom |
Dependency Management
Swift Package Manager (SPM)
Strengths:
- Native to Xcode
- No additional tools
- Fast, clean
- Apple's official solution
- Growing ecosystem
Limitations:
- Some packages not available
- Occasional Xcode issues
✅ Use SPM when:
- Starting new project (recommended default)
- Want simplicity
- Packages available via SPM
CocoaPods
Strengths:
- Mature ecosystem
- Most libraries available
- Good for mixed Swift/ObjC
- Centralized versioning
Limitations:
- Requires Ruby/bundler
- Workspace management
- Slower than SPM
✅ Use CocoaPods when:
- Library only on CocoaPods
- Existing project uses it
- Need specific pods
Carthage
Strengths:
- Decentralized
- No code modification
- Builds frameworks
Limitations:
- Declining usage
- Manual integration
- M1/M2 issues
⚠️ Consider alternatives - Carthage is declining
Manual Integration
Strengths:
- Full control
- No dependency manager needed
Limitations:
- Manual updates
- Time-consuming
✅ Use Manual when:
- Single dependency
- Want full control
- Dependency not in package managers
Recommendation
Default: Swift Package Manager
- Use unless specific reason not to
- Modern, supported, growing
Fallback: CocoaPods
- If package not in SPM
- Legacy projects
Popular Third-Party Libraries
Analytics & Crash Reporting
| Library | Purpose | Recommendation |
|---|---|---|
| Firebase Analytics | Analytics + Crashlytics | Popular, free tier |
| Sentry | Crash reporting | Good for serious apps |
| Crashlytics | Crash reporting | Industry standard |
| Mixpanel | Advanced analytics | Good for product analytics |
Recommendation: Firebase (free, comprehensive) or Sentry (professional)
Networking & APIs
| Library | Purpose | When to Use |
|---|---|---|
| Alamofire | HTTP networking | Complex networking |
| Moya | Type-safe API layer | Large apps |
| Apollo iOS | GraphQL client | GraphQL APIs |
Recommendation: URLSession (default) or Alamofire (if needed)
UI Components
| Library | Purpose | When to Use |
|---|---|---|
| Lottie | Animations | Rich animations |
| SnapKit | Auto Layout DSL | UIKit projects |
| SDWebImage | Image loading | UIKit image caching |
| Kingfisher | Image loading | Swift-first image caching |
Recommendation: Only add if needed; native solutions often sufficient
Authentication
| Library | Purpose | When to Use |
|---|---|---|
| Firebase Auth | Auth backend | Need backend-as-service |
| Auth0 | Auth service | Enterprise auth |
| Sign in with Apple | Native auth | Recommended for all apps |
Recommendation: Sign in with Apple (required for social auth) + Firebase/Auth0 if needed
Database/Persistence
| Library | Purpose | When to Use |
|---|---|---|
| Realm | Mobile database | Alternative to Core Data |
| GRDB | SQLite wrapper | SQL preference |
Recommendation: Core Data/SwiftData (native) unless specific need
Testing
| Library | Purpose | When to Use |
|---|---|---|
| Quick/Nimble | BDD testing | Team prefers BDD |
| Snapshot Testing | UI snapshot tests | Visual regression testing |
| OHHTTPStubs | Network mocking | Mock network requests |
Recommendation: XCTest (built-in) + Snapshot Testing if needed
Utilities
| Library | Purpose | When to Use |
|---|---|---|
| SwiftLint | Code linting | Code quality (recommended) |
| SwiftFormat | Code formatting | Consistent style |
| R.swift | Type-safe resources | Large projects |
Recommendation: SwiftLint (always) + SwiftFormat
Backend Options
CloudKit
Best for: Apple ecosystem apps with simple backend needs
Strengths:
- Free (generous limits)
- Native integration
- iCloud integration
- Privacy-focused
Limitations:
- Apple ecosystem only
- Limited compared to full backend
- Learning curve
✅ Use CloudKit when:
- Simple data sync
- Apple ecosystem only
- Free solution needed
- Privacy important
Firebase
Best for: Rapid development, cross-platform apps
Strengths:
- Comprehensive BaaS
- Real-time database
- Free tier
- Great documentation
- Authentication included
Limitations:
- Vendor lock-in
- Can get expensive at scale
- Google-owned
✅ Use Firebase when:
- Need full backend quickly
- Cross-platform app
- Real-time features
- Want managed solution
Supabase
Best for: Open-source Firebase alternative
Strengths:
- Open source
- PostgreSQL backend
- Real-time capabilities
- Good pricing
Limitations:
- Newer than Firebase
- Smaller community
✅ Use Supabase when:
- Want Firebase-like but open source
- Need PostgreSQL
- Prefer open source
Custom Backend
Best for: Specific requirements, full control
Technologies:
- Vapor (Swift)
- Node.js + Express
- Django/Flask (Python)
- Ruby on Rails
✅ Use Custom Backend when:
- Specific requirements
- Need full control
- Have backend expertise
- Complex business logic
Backend Recommendations
| Use Case | Recommendation |
|---|---|
| Simple sync | CloudKit |
| Rapid development | Firebase |
| Open source preference | Supabase |
| Complex requirements | Custom backend |
| No backend needed | Local-only app |
Development Tools
Essential Tools
| Tool | Purpose | Cost | Recommendation |
|---|---|---|---|
| Xcode | IDE | Free | Required |
| SF Symbols | System icons | Free | Use extensively |
| Instruments | Profiling | Free | Learn it |
| SwiftLint | Linting | Free | Always use |
| Proxyman/Charles | Network debugging | Paid/Free | Very helpful |
CI/CD Options
| Service | Best For | Cost |
|---|---|---|
| Xcode Cloud | Apple integration | Paid |
| GitHub Actions | GitHub projects | Free tier |
| Bitrise | Mobile-focused | Free tier |
| Fastlane | Automation | Free (self-hosted) |
Recommendation: GitHub Actions (if on GitHub) or Xcode Cloud
Decision Framework
Step 1: Start with Defaults
Recommended default stack for new iOS apps:
UI: SwiftUI (iOS 15+)
Architecture: MVVM
Persistence: Core Data or SwiftData
Networking: URLSession
Dependencies: Swift Package Manager
Linting: SwiftLint
Backend: CloudKit (if needed) or FirebaseStep 2: Adjust for Requirements
Modify based on:
- iOS version constraints
- Team experience
- Specific features needed
- Performance requirements
- Budget constraints
Step 3: Minimize Dependencies
Philosophy: Use native solutions unless there's a clear benefit to third-party
Before adding a dependency, ask: 1. Can I use a native solution? 2. Is this dependency actively maintained? 3. Does the benefit outweigh the cost? 4. How many users does it have? 5. Is it well-documented?
Sample Tech Stacks
Minimal Personal Project
UI: SwiftUI
iOS: 16+
Architecture: MVVM
Persistence: UserDefaults + File System
Networking: URLSession
Dependencies: SPM
Third-party: None (native only)Standard Commercial App
UI: SwiftUI
iOS: 15+
Architecture: MVVM
Persistence: Core Data + CloudKit
Networking: URLSession or Alamofire
Dependencies: SPM
Third-party:
- SwiftLint (linting)
- Firebase Analytics & Crashlytics
- Kingfisher (image caching)
Backend: Firebase or CustomEnterprise App
UI: SwiftUI + UIKit (hybrid)
iOS: 14+
Architecture: MVVM or TCA
Persistence: Core Data
Networking: Moya or Custom
Dependencies: SPM + CocoaPods
Third-party:
- SwiftLint
- Sentry (crash reporting)
- Custom analytics
- Auth0 (authentication)
Backend: Custom REST/GraphQL API
CI/CD: Xcode Cloud or BitriseStartup MVP
UI: SwiftUI
iOS: 15+
Architecture: MVVM
Persistence: Firebase Firestore
Networking: URLSession
Dependencies: SPM
Third-party:
- Firebase (everything)
- SwiftLint
Backend: FirebaseResources
- Swift Package Index - Discover SPM packages
- CocoaPods - CocoaPods directory
- iOS Dev Directory - Curated iOS resources
- Awesome iOS - Curated list
- Swift.org - Official Swift resources
Summary
Default Recommendations:
- UI: SwiftUI (unless iOS <14)
- Minimum iOS: 15 (good balance)
- Persistence: Core Data or SwiftData
- Networking: URLSession (sufficient for most)
- Dependencies: Swift Package Manager
- Backend: CloudKit (simple) or Firebase (comprehensive)
Key Principle: Start simple, add complexity only when needed