Skip to content

Instantly share code, notes, and snippets.

@buranmert
Last active March 22, 2017 13:39
Show Gist options
  • Save buranmert/eb200efd98637fd8101c3098ed026d1c to your computer and use it in GitHub Desktop.
Save buranmert/eb200efd98637fd8101c3098ed026d1c to your computer and use it in GitHub Desktop.
Augment-iOS Technical Assignment

Augment iOS Technical Assignment

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 (feel free to find a fancier name to your demo app!)

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!

UX flow

  1. The app opens to the homepage which is the only page in the app
  2. Homepage fetches items from network and display them in its collection view. (you can show a simple alert in case of error)
  3. When the user favorites an item via the switch in the cell:
    1. if the item's asset is already downloaded to disk, do nothing
    2. 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")
  4. When the user unfavorites an item via the switch in the cell:
    1. if the item's asset does already NOT exist on disk, do nothing
    2. if the item's asset is already being downloaded, cancel download task
    3. otherwise, remove the asset from disk

Let's break it down:

Data

Network

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!

Persistence layer

You need persistence for 2 things:

  1. Downloaded files
  2. 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.

UI layer

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:

UI-proto

Your UICollectionViewCell should have 3 or 4 components:

  1. Title label: Displays item's name
  2. Favorite/Unfavorite switch: When you favorite an item, its asset should be downloaded automatically
  3. Indicator view: Can be UILabel as well, just to tell the user if the item's asset exists on disk or not
  4. Progress view: Can be UIProgressView or you can animate Indicator View's background color to display download progress to the user

Conclusion

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment