- MVVM
- Swift 3
- Core Data
- Adaptive layout
- Unit Test for view model
- Pagination
- Custom delegates
- Listing (user can search item using olx public API)
- ListViewController.swift
- ListingViewModel.swift
- Detail of item
- DetailViewController.swift
User can search by adding text in searchBar at listing screen. We check respective data in local storage, if we got data locally then show it in a tableview and user can refresh data using pull to refresh.
Otherwise make web service call to olx API. We load more data once user scroll down and want to see more data.
Error message shown if network issue or any other issue comes, user can retry by taping in error message.
UI of application is design in Main.storybaord. UI of application is adaptive to portrait and landscape orientations. User can see the difference by rotating there device on both listing and detail screen.
Delegate approach is used in ListingViewModel.swift to notify viewcontroller any changes
- Unit test cases has written for view model ListingViewModel.swift in file ListingViewModelTests.swift
- Use Kingfisher for image cache
- Fine-tune UI
- Further improvement in local storage (coredata)
- Some other edge cases
- Increase test case coverage
- URL http://api-v2.olx.com/items
- request type : GET
Query Parameter
Nombre | Tipo | Descripción |
---|---|---|
location | string | For this exercise use www.olx.com.ar |
searchTerm | string | (Required) Search term (e.g. "Peugeot", "iphone"). |
pageSize | integer | (Opcional) Result data size |
offset | integer | (Opcional) Offset the list of returned business results by this amount. |