book--hacking-with-swift/challenges/private-photos-app/Private Gallery/README.md

1.2 KiB
Raw Permalink Blame History

Private Photos App

Challenge

Your final challenge is to create a private photos app think Mission Impossible, or at least as close as you can get to it in a programming tutorial!

The Notes app for iOS has the ability to lock certain notes so that Touch ID must be used to reveal the note, and your mission is to create something similar for a photo library.

At its most basic, youre going to want to start your app with something like project 10: a collection view, plus the ability to load images. In the wrap up for that chapter, I mentioned using picker.sourceType = .camera, and heres your chance to use it so that users can take photos straight to their private library.

Once you have the collection view working, go to project 12 to add support for NSCoding so that you can write data to disk.

Finally, jump to project 28 to add support for Touch ID. If you wanted to be really fancy, you could prompt the user for a fallback password for times when Touch ID wasnt working using a UIAlertController similar to project 5 ought to do the trick.

For bonus points: make the app show a fake set of innocuous images when it runs, only loading the private images when the user authenticates.