Take Home Assessment

⏱ 2-3 hrs

At FitnessAI, we love building UI libraries that are highly extendable and customizable. One such example is a suped-up version of UIAlertController.

Preview

Download FitnessAI and tap around in settings to see more examples. Tap ... next to any exercise on the homepage or "Rest Timer" in settings for more advanced examples.

Task

Create a class, ActionSheetController, that mimics UIAlertController, but accepts custom header views and actions.

  1. Use a UITableView as so we can support an unlimited number of rows.
  2. Scrolling should be supported after the height of the whole sheet is greater than 75% of the device height.
  3. Support passing through a custom view for the header view.
  4. Implement the following methods:
    1. addHeader(image: UIImage?, title: String?, message: String?)
    2. addHeader(view: UIView)
    3. addAction(title: String, type: .normal | .destructive, action: (() -> ())? = nil)
    4. addCustomAction(view: UIView, action: (() -> ())? = nil)
      1. (to support something like the slider example above)
    5. addDoneAction(title: String, type: .normal | .destructive, action: (() -> ())? = nil)
  5. Try your best to mimic exact scroll / animation behavior inside of FitnessAI.
  6. Try your best to make ActionSheetController have as similar an implementation to UIAlertController as possible
  7. Have fun! Please be honest about how much time this takes to implement :)

Deliverables

Create a new Xcode project to showcase your work. Your app should be a single view application with a UIViewController at its root containing multiple buttons that showcase different ActionSheetController implementations. At the very least, include buttons that launch the two implementations in the Preview section above.

When you're done, compress your Xcode project as a .zip file and email it to [email protected] for next steps :)

Downloads