There is no restrictions on 3rd party libraries and package managers. But please use them only if they make things easier. We expect you to write in Objective-C or the latest version of Swift.
TheAppWithZeroUsers is a great app where you list the items that you get via a network endpoint and you can favorite/unfavorite them by tapping on the items. Thanks to this great favorite feature, you can make sure that the asset associated with the item is downloaded to your device! You can even watch the progress of download real-time!
- The app opens to the homepage which is the only page in the app
- Homepage fetches items from network and display them in its collection view. (you can show a simple alert in case of error)
- When the user favorites an item via the switch in the cell:
- if the item's asset is already downloaded to disk, do nothing
- otherwise, start downloading the asset and display its progress in your cell's "progress view". (don't show alert in case of error. the user already can see the asset is not on disk via "indicator view")
- When the user unfavorites an item via the switch in the cell:
- if the item's asset does already NOT exist on disk, do nothing
- if the item's asset is already being downloaded, cancel download task
- otherwise, remove the asset from disk
TheAppWithZeroUsers uses the following URL to fetch its content:
GET https://webservice.augment.com/v2/galleries/1b39f018-7966-4381-b296-91dd336f2d99/model3ds
Feel free to discover the returned JSON response with your favorite HTTP client but we can tell you that you only need name
, uuid
and model_url
fields in the JSON objects of the array, you can ignore the rest. It will be a big bonus if you also use updated_at
to make sure you always have the latest version of the asset on disk!
You need persistence for 2 things:
- Downloaded files
- Favorite items
Where/how you will store them is totally up to you. You can use NSUserDefaults
to store favorite item identifiers or you can even use CoreData
or any other 3rd party solution for the same thing.
Your app must have great UI so that even a blind man should be amazed by its beauty! No, we are kidding :| We don't care about beauty in this demo. You can find a rough draft of the expected UI right below, but let your imagination fly:
Your UICollectionViewCell
should have 3 or 4 components:
- Title label: Displays item's name
- Favorite/Unfavorite switch: When you favorite an item, its asset should be downloaded automatically
- Indicator view: Can be
UILabel
as well, just to tell the user if the item's asset exists on disk or not - Progress view: Can be
UIProgressView
or you can animate Indicator View's background color to display download progress to the user
Please feel free to ask whatever bugs you before actually starting the assignment! We know how precious the time is, so let's make sure that we are on the same page before investing our time on this! There is NO deadline for this assignment. If you find yourself investing too much time on it, you can send it with some minor bugs too (but please tell us about your known bugs, they are much better than the unknown ones :)
Lastly, we prefer looking at your work via a GitHub pull request/GitLab merge request which contains only your changes (please leave "New Project" boiler-plate out if possible). Only if you can't create a pull/merge request due to some reasons, please send it via e-mail