Welcome to the comprehensive documentation for Sifo, a native iOS todo list application built with Swift 6.2, SwiftUI, and Clean Architecture principles.
- User Guide - Complete guide to using Sifo
- Getting started
- Managing todos
- Categories and priorities
- Filtering and organizing
- CloudKit sync
- Troubleshooting
-
Developer Guide - Development setup and workflow
- Project setup
- Development workflow
- Building new features
- Testing strategies
- Debugging techniques
- Common tasks
-
Architecture Documentation - Detailed architectural design
- Clean Architecture layers
- Dependency management
- Design patterns
- State management
- Common patterns
-
Architecture Diagrams - Visual architecture diagrams
- System overview
- Layer dependencies
- Data flow sequences
- State machines
- Navigation flows
-
API Reference - Complete API documentation
- All modules and packages
- Classes, protocols, and methods
- Usage examples
- Error handling
- Best practices
-
Package Guide - SPM package documentation
- Package overview
- Individual package details
- Creating new packages
- Package best practices
- CLAUDE.md - Instructions for Claude Code
- Project overview
- Development environment
- Architecture constraints
- Swift and SwiftUI guidelines
Use Sifo: β Start with User Guide
Contribute to Sifo: β Read Developer Guide β Architecture Documentation
Understand the architecture: β Review Architecture Diagrams β Architecture Documentation
Look up API details: β Search API Reference
Create a new feature: β Follow Developer Guide Β§ Building New Features
Understand packages: β Read Package Guide
Sifo follows Clean Architecture with strict separation of concerns:
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Presentation Layer (Views & ViewModels) β
β TodoListView, TodoDetailView, TabBarView β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β depends on
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Business Logic Layer (Use Cases) β
β TodoUseCase, Protocols β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β depends on
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Data Layer (Repository) β
β TodoRepository, SwiftData Models β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
Key Principles:
- Unidirectional dependencies (outer β inner)
- Protocol-oriented design
- Dependency injection via DIContainer
- State machine pattern for ViewModels
- SwiftData with CloudKit sync
Sifo uses 8 local Swift Package Manager (SPM) packages:
- DependencyContainer - Dependency injection
- DevPreview - Preview support with in-memory data
- TodoRepository - SwiftData persistence
- TodoUseCase - Business logic, models, and adapters
- TodoListView - List feature
- TodoDetailView - Add/edit feature
- TodoUI - Shared UI components
- TabBarView - Main navigation
See Package Guide for detailed information.
What is it? A software design philosophy that separates concerns into layers with clear dependency rules.
Why use it?
- Testability (easy to test each layer)
- Maintainability (changes are localized)
- Flexibility (swap implementations)
Learn more:
What is it? ViewModels use enum-based states to represent UI state explicitly.
Example:
public enum State: Equatable {
case idle
case loading
case loaded([TodoItemAdapter])
case error(String)
}Why use it?
- Impossible states become impossible
- Clear state transitions
- Easy to test and debug
Learn more:
What is it? Factory classes that compose views with their dependencies.
Example:
let builder = TodoListBuilder(container: diContainer)
let view = try builder.buildTodoListView(router: router)Why use it?
- Centralized dependency injection
- Testable view creation
- Decouples views from DI container
Learn more:
What is it? DTOs that transform SwiftData models into view-friendly structures.
Example:
// SwiftData model
@Model class Todo { ... }
// Adapter (DTO)
struct TodoItemAdapter: Sendable {
let id: PersistentIdentifier
let title: String
// ... UI-friendly computed properties
}Why use it?
- Decouples views from SwiftData
- Sendable for concurrency safety
- UI-specific computed properties
Learn more:
What is it? All inter-layer communication happens through protocols.
Example:
// Protocol definition
protocol TodoUseCaseProtocol {
func fetchTodos(filter: FilterOption) async throws -> [TodoItemAdapter]
}
// Implementation
class TodoUseCase: TodoUseCaseProtocol { ... }
// Usage (depends on protocol, not concrete type)
let useCase: TodoUseCaseProtocol = try container.requireResolve(TodoUseCaseProtocol.self)Why use it?
- Testability (easy mocking)
- Flexibility (swap implementations)
- Decoupling (layers don't know concrete types)
Learn more:
| Technology | Version | Purpose |
|---|---|---|
| Swift | 6.2 | Programming language with strict concurrency |
| SwiftUI | Latest | Modern declarative UI framework |
| SwiftData | Latest | Persistence framework with CloudKit sync |
| Xcode | 26.2+ | IDE and build tools |
| iOS | 26.0+ | Minimum deployment target |
| Swift Testing | Built-in | Modern testing framework |
| SPM | Built-in | Package management |
Sifo uses a comprehensive testing strategy:
- ViewModels: Test state transitions and business logic
- Use Cases: Test business rules and validation
- Adapters: Test data transformations
- Repository: Test SwiftData operations with in-memory container
- Fake Use Cases: Simulate business logic
- Fake Repositories: Simulate data access
- Fake Routers: Simulate navigation
Run tests:
# All tests
xcodebuild test -workspace Sifo.xcworkspace -scheme Sifo \
-destination 'platform=iOS Simulator,name=iPhone 17 Pro'
# Package-specific tests
swift test --package-path TodoRepositoryLearn more:
β Rich Todo Management
- Title, notes, due date, priority, categories
- Mark complete/incomplete
- Edit and delete
β Filtering
- All todos
- Active (incomplete)
- Completed
β Organization
- Categories with colors
- Priority levels (None, Low, Medium, High)
- Drag-and-drop reordering
β Persistence
- SwiftData local storage
- CloudKit sync across devices
β Modern iOS Features
- SwiftUI with @Observable
- Native Tab API
- Pull-to-refresh
- Swipe actions
- Sheet navigation
π Future updates may include:
- Category management UI
- Search functionality
- Recurring todos
- Subtasks/checklists
- Widgets
- Apple Watch support
- Strict concurrency mode enabled
- All UI operations on
@MainActor - SwiftData operations are
@MainActorisolated - No legacy GCD (
DispatchQueue)
@Observableinstead ofObservableObject- Native APIs over deprecated ones
- Static member lookup (
.circlevsCircle()) - Modern Foundation (
URL.documentsDirectory)
- Extract views into structs
- Use
@Statefor view models - Custom bindings for form fields
- Avoid force unwrapping
- No hard-coded values
Learn more:
-
Understand the basics:
- Read User Guide
- Explore the app
-
Learn the architecture:
- Review Architecture Diagrams
- Understand layer separation
-
Set up development:
-
Understand packages:
- Read Package Guide
- Explore package dependencies
-
Study design patterns:
- Review Architecture Documentation Β§ Design Patterns
- Understand state machines, builders, adapters
-
Write tests:
- Follow Developer Guide Β§ Testing
- Create fake implementations
-
Build new features:
- Follow Developer Guide Β§ Building New Features
- Add new packages
-
Optimize performance:
- Study Developer Guide Β§ Performance Optimization
- Profile with Instruments
-
Contribute:
- Review Developer Guide Β§ Contributing
- Submit pull requests
We welcome contributions! Please follow these steps:
-
Read the documentation:
-
Set up your environment:
- Clone repository
- Open
Sifo.xcworkspace - Run tests
-
Make changes:
- Follow coding conventions
- Add tests for new features
- Update documentation
-
Submit pull request:
- Follow commit message conventions
- Ensure all tests pass
- Update CHANGELOG (if applicable)
Learn more:
"No such module 'TodoUseCase'" β See Developer Guide Β§ Troubleshooting
Circular dependency errors β See Package Guide Β§ Troubleshooting
State not updating UI
β Check @Observable and @MainActor annotations
SwiftData crashes
β Ensure all operations on @MainActor
Dependency not found
β Check AppComposition.swift registration
Todo doesn't appear after saving β See User Guide Β§ Troubleshooting
CloudKit not syncing β Check iCloud settings and internet connection
All questions should be answerable by the documentation:
- User Guide - For users
- Developer Guide - For developers
- API Reference - For API details
Report bugs or request features:
- Check existing issues on GitHub
- Create new issue with details
- Include steps to reproduce
- Discussions on GitHub
- Code reviews on pull requests
See LICENSE file for details.
Built with:
- Swift 6.2
- SwiftUI
- SwiftData
- CloudKit
- Modern iOS best practices
Inspired by Clean Architecture principles and protocol-oriented design.
- Swift Documentation
- SwiftUI Documentation
- SwiftData Documentation
- CloudKit Documentation
- Swift Concurrency
- Clean Architecture by Robert C. Martin
- Protocol-Oriented Programming in Swift
- Swift Concurrency Manifesto
When updating documentation:
- User-facing changes β Update User Guide
- Architecture changes β Update Architecture Documentation
- New APIs β Update API Reference
- New packages β Update Package Guide
- Development workflow changes β Update Developer Guide
- Visual diagrams needed β Update Architecture Diagrams
- Project guidelines β Update CLAUDE.md
Last Updated: January 2026 Documentation Version: 1.0 Project: Sifo iOS Application
docs/
βββ README.md β You are here
βββ USER_GUIDE.md User documentation
βββ DEVELOPER_GUIDE.md Developer onboarding and workflow
βββ API_REFERENCE.md Complete API documentation
βββ ARCHITECTURE_DIAGRAMS.md Visual architecture diagrams
βββ PACKAGE_GUIDE.md SPM package documentation
../
βββ ARCHITECTURE.md Detailed architecture documentation
βββ CLAUDE.md Claude Code instructions
Happy coding! π