This project is an iOS application that displays the most recent articles from the New York Times API. It follows the MVVM-C (Model-View-ViewModel-Coordinator) architecture and applies SOLID principles. The application is built with Swift and SwiftUI.
This iOS application displays the most recent articles from the New York Times API. It follows the MVVM-C (Model-View-ViewModel-Coordinator) architecture, adheres to SOLID principles, and is built with Swift and SwiftUI.
The project follows the MVVM-C architecture, with responsibilities divided as follows:
- Model: Represents the data structures and entities used in the application.
- View: Displays the user interface and reacts to user interactions.
- ViewModel: Acts as an intermediary between the View and the Model, providing data and handling business logic.
- Coordinator: Handles navigation and flow control in the application.
The Repository design pattern is implemented to retrieve data from the remote database using the New York Times APIs.
- Swift
- SwiftUI
The project relies on the following dependencies:
- Moya: A network abstraction layer built on top of Alamofire.
- AlamofireLogger: A logging framework for Alamofire requests.
To install and set up the project, follow these steps:
-
Clone the repository:
git clone <repository_url> cd TechnologyAssessment
-
Install iOS dependecy: Brefore open the project you have to nake sure you install Ruby and Cocoapods for ios dependencies
brew install ruby brew install cocoapods
-
Install project dependencies using CocoaPods:
pod install
-
Open the project: Open the generated TechnologyAssessment.xcworkspace file in Xcode.
-
Run the project: Press Cmd+R or select Product > Run to build and run the project on a simulator
The project includes unit tests that cover the repository and view model components. To run the tests, follow these steps:
In Xcode, open the TechnologyAssessment.xcworkspace file.
Select the test target you want to run, such as TechnologyAssessmentTests.
Press Cmd+U or go to Product > Test to run the tests