This repository contains practical examples of various iOS architecture patterns and development concepts, demonstrating clean code practices and modern Swift development techniques.
A comprehensive implementation of Clean Architecture principles in iOS, featuring:
- Domain Layer: Entities, Use Cases, and Repository protocols
- Data Layer: Data sources and repository implementations
- Presentation Layer: ViewModels and Views using SwiftUI
- Dependency Injection: DIContainer for managing dependencies
Demonstrates different approaches to dependency injection in SwiftUI:
- Custom DI Container implementation
- Environment-based injection
- Service protocols and implementations
- Clean separation of concerns
A robust networking layer implementation showcasing:
- Protocol-based network service architecture
- Error handling and retry mechanisms
- Mock implementations for testing
- Comprehensive unit tests
- User management with CRUD operations
Navigation management using the Coordinator pattern:
- App-level coordination
- Deep link handling
- Modular view navigation
- Separation of navigation logic from views
Complete VIPER (View, Interactor, Presenter, Entity, Router) implementation:
- Todo application demonstrating all VIPER components
- Modular architecture with clear responsibilities
- Navigation routing between modules
This repository serves as a practical guide for:
- Understanding different iOS architecture patterns
- Implementing clean code principles
- Managing dependencies effectively
- Building testable and maintainable code
- Handling navigation and app flow
For detailed explanations and insights about these patterns, check out my articles on Medium: @maatheusgois
Topics covered include:
- iOS Architecture Patterns
- Clean Code in Swift
- Dependency Injection Techniques
- SwiftUI Best Practices
- Testing Strategies
- Modern iOS Development
Each example is self-contained and can be run independently:
- Clone the repository
- Navigate to any example folder
- Open the
.xcodeprojfile in Xcode - Build and run the project
- Xcode 14.0+
- iOS 16.0+
- Swift 5.7+
Feel free to explore, learn, and suggest improvements. Each example demonstrates specific concepts that can be applied to real-world iOS development.
This repository is part of my ongoing study and sharing of iOS development best practices. For more insights and detailed explanations, visit my Medium profile.