The Movies App is a simple yet effective movie application designed using the MVVM (Model-View-ViewModel) architecture. This project showcases key principles of Swift development, including network management, programmatic UI, and effective communication patterns.
To ensure maintainability and better organization, the following folder structure was implemented:
- Models: Contains struct models responsible for transforming JSON data into Swift structs.
- Networking: Includes a generic network manager and service layer, utilizing the
Result
type for better error handling and response management. - Views: Houses custom cells and reusable views.
- ViewModels: Contains view model classes that facilitate communication between the view and other layers.
- Extensions: Includes reusable extension functions for enhanced functionality.
- Developed a general-purpose network manager capable of handling API requests.
- Supports URLSessionDataTask cancellation, ensuring robust and efficient networking.
- Utilized Swift's Result type to handle success and failure cases in network operations.
- Improves code reliability and readability by managing errors effectively.
- Leveraged the Codable protocol for transforming JSON data into Swift structs.
- Used the CodingKey protocol for mapping JSON keys to struct properties.
- All UI elements were created programmatically.
- Customized views and cells were implemented for a dynamic and reusable user interface.
- Employed the MVVM pattern to separate concerns and improve testability.
- Ensured communication between the ViewModel and the View using binding and closures.
- Addressed potential retain cycles with proper usage of
weak self
.
- Used UICollectionView to create visually appealing collections for displaying movie data.
- Implemented pagination to fetch data in a seamless and efficient manner.
- Adopted MVVM Binding to link the view with the view model dynamically.
- Demonstrated the use of closures and protocol-based communication for flexible and modular design.
- Swift: Programming language.
- MVVM Architecture: Ensures separation of concerns and better maintainability.
- URLSession: For network requests.
- UICollectionView: For creating dynamic and scrollable layouts.
- Result Type: For error handling and result management.
- Codable Protocol: For JSON parsing and model creation.