News
Preview
Requirements
Please create a new application with following conditions
- Use https://newsapi.org/ as data source
- Application must be written in Kotlin OR Swift
- Application must be written in MVVM and MVP, and write a test case.
- Use any framework and library that you know and understand
- Application must have this feature: a. News List with image b. News detail with image c. Link to open original news d. Have 3 tab view at home and it will show list about: i. Top Headline news with image ii. Custom news based on user preferences (user must be presented with keyword selection from: bitcoin, apple, earthquake, animal. User can only choose one keyword) iii. Profile
- User can register with username at profile and data (user preferences) will be saved on local storage
- Please initialize version control with git for checking git history
- Please upload to Github
Achivements
- Using MVVM architecture (MVVM-C)
- Using RxSwift to bind data
- Using 3rd party SDWebImage to load remote images
- Unit test
- 3 Tabs: Headlines, News, Profile
- Register with username, saved the username and category on local storage
- Views detail article, open safari to get more detail
- Transforms the image from list view to detail view with a smooth animation
- Supports paging (load, pull to refresh, load more)
- Handles some common errors
- Using version control with git
- Implement Cache data for offline
- Supports dark mode
- Supports localization
Setup & Run
Setup Cocoapods
This project uses Cocoapods to manage 3rd parties, you have to run some commands to setup it.
- Open Terminal App
- $
sudo gem install cocoapods
- enter your computer password, then enjoy a cup of tea and wait for installing
You can refer to the offical information here cocoapods.org
Install 3rd parties & open App
- Open Terminal app
- $
cd <the/path/to/project>
- $
pod install
- $
open News.xcworkspace
Other
I have been using swiftgen system-wide to generate localization strings and asset colors. In case you want to change it, you have to do the following steps:
- Install swiftgen
- Open Terminal app
- $
cd <the/path/to/project/{Source code Project}>
// move to the folder containingswiftgen.yml
- $
swiftgen
It's good if you're aware of swiftgen. If not, you can get more information here, swiftgen. In my memory, the guidance is specific enough.