An iOS UIKit prototype of an online News Reader.
- Xcode 14.1 (Xcode 13.x not available due to developer's macOS version requirement).
- Open the
NewsReader.xcodeproj
and start building. - Swift Package Manager is used as the dependency manager of choice, so no further installation steps required.
- Unit tests are included as part of the main
NewsReader
scheme. - For UI tests, switch to
NewsReaderUITests
scheme to trigger.
There are 2 main layers of the application:
- Presentation layer for controlling the UI, MVVM is used with closure callbacks for data binding due to its simplicity. For more complex data binding mangements a Functional Reactive Programming framework should be used e.g. Combine, RxSwift, ReactiveSwift etc.
- Data layer for handling API requests and local storages, all calls to data providers (
URLSession
,UserDefaults
etc.) are wrapped inside protocols to utilise dependency injection for testing purpose.
- Kingfisher for asynchronous image loading & caching.
- Ambassador for stubbing network requests in UI tests.
- All screens are sharing a single
Main.storyboard
file, can split out into separate storyboards for better management. - Navigation are performed directly inside view controllers, coordinator/router pattern can be utilised to improve reusability and testability of navigations.
- Timestamp values from the JSON are parsed as
Int
, property wrappers can be implemented to automate the parsing of this value intoDate
type for more usability client side. - Article Details screen has no view model due to its simplicity, can introduce as more requirements arise.