This project is a simple example of using Swift with MVVM and Clean architecture for news related app.
- Login using an API key (News.org)
- Fetch and display a list of news articles from the API (News.org)
- Implement search, date selection, and sort by filters
- Allow switching between grid and list layouts for the article list
- Enable users to swipe to add/remove favorites for articles using core data (Favourite Screen with UITableView and Search Screen with UICollectionView)
- Display a badge on the tab bar indicating the number of favorite articles (Using userdefualts)
- Show a detailed view for each selected article (Open URL and Share Article Functionality)
- Provide an option to change the API key
- Allow users to log out of the app
- iOS 15.0+
- Xcode 15.0+
- Swift 5.0+
-
Clone the repository:
-
Open the project in Xcode:
- open News.xcworkspace
-
Build and run the project on your preferred simulator or device.
The project follows the MVVM & Clean architecture pattern:
- Model: Holds the data
- View: Views that display the data.
- ViewModel: Manages the data for a view by interacting with the model and preparing the data for presentation in the view.
- Repository: Responsible for interacting with the data.
- ViewController: Manages the UIKit view and binds to ViewModel
- Manager: Manage a functionality based on features
- Constants: Holds the variables whose values can't be changed
- Extension: Allow you to extend an existing class, struct, enumeration, or protocol with new functionality
News/
├── AppDelegate.swift # Entry point of the app
├── Models/
├── ViewControllers/
├── ViewModels/
├── Views/
├── Repository/
├── Managers/
├── Extension/
├── Constants/
├── Utilities/
├── News.xcdatamodeld //Coredata
- Swift Documentation
- MVVM Architecture Patterns
- Clean Architecture
- Solid Principal
- For any questions or suggestions, please open an issue or contact akabaridixit009@gmail.com