This project is a Native News App developed in Swift and SwiftUI, following the MVVM and Singleton design patterns. The initial setup and basic functionalities were implemented following TundsDev's tutorial on YouTube, with additional features and enhancements added independently.
- News API Integration: Fetches the latest news from Lil Software's News API.
- User Authentication: Sign up and login functionalities allowing users to create accounts and login.
- SQLite Database Integration: Stores user data, articles, and favorites using SQLite.
- Favorites Management: Users can add and remove favorite articles, with favorites stored and fetched from the database.
- MVVM and Singleton Design Patterns: Ensures a clean, maintainable, and scalable codebase.
The project is organized into different parts and folders, following the MVVM design pattern.
The app uses Lil Software's News API to fetch news articles. The API endpoint is:
https://api.lil.software/news
The app uses SQLite for database management, with the following entities:
- User: Stores user information.
- Articles: Stores articles that users have favorited.
- Favorites: Stores the primary key (URL) of the articles and the username of the user who favorited them.
- Clone the repository:
git clone https://github.com/your-username/native-news-app.git
- Open the project in Xcode:
cd native-news-app
open NativeNewsApp.xcodeproj
-
Install dependencies (if any).
-
Build and run the project on your preferred iOS simulator or device.
- Sign Up: Create a new account by providing a username and password.
- Login: Login with your credentials.
- Browse News: View the latest news fetched from the API.
- Favorite Articles: Add articles to your favorites by tapping the favorite button.
- Manage Favorites: View and manage your favorite articles from the favorites section.
The MVVM pattern is used to separate concerns within the app:
- Model: Represents the data and business logic.
- View: Displays the UI components and is bound to the ViewModel.
- ViewModel: Handles the presentation logic and communicates between the Model and the View.
The Singleton pattern is used to ensure a single instance of the database manager throughout the app, providing a global point of access.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
- TundsDev YouTube Tutorial
- Lil Software's News API
- SQLite Documentation