Adopting 3D Touch
As your first app, the FoodPin app is pretty good. That said, if you want to make it even better and adopt some modern technologies provided by the iOS devices, I have two more chapters for you.
Since the release of the iPhone 6s and 6s Plus, Apple introduced us an entirely new way to interact with our phones known as 3D Touch. It literally adds a new dimension to the user interface and offers a new kind of user experience. Not only can it sense your touch, iPhone can now sense how much pressure you apply to the display.
With 3D Touch, you now have three new ways to interact with the iPhones: Quick Actions, Peek, and Pop. Quick actions are essentially shortcuts for your applications. When you press an app icon a little harder, it shows a set of quick actions, each of which allows you to jump straight to a particular part of an app. It simply saves you a few "taps".
Peep and Pop purposely want to give users a quicker access to the app's contents. Take the built-in Photos app as an example. When you press a little harder on a photo, the app "Peeks" the photo in a pop-up. If the preview is good enough for you, simply release your finger and you're back to the photo album. But if you want more than a preview, just press a bit harder to "Pop" into a full view.
Since iOS 9, Apple provided a set of APIs for developers to work with 3D Touch. In this chapter, I will go through some of the new APIs with you. More specifically, we will add Quick Actions, Peek, and Pop features to the FoodPin app.
Home Screen Quick Actions
First, let's talk about Quick Actions. Apple offers two types of quick actions: static and dynamic. Static quick actions are hardcoded in the
Info.plist file. Once the user installs the app, the quick actions will be accessible, even before the first launch of the app. As the name suggests, dynamic quick actions are dynamic in nature. The app creates and updates the quick actions at runtime. Take the News app as an example. Its quick actions show some of the most frequently accessed channels. They must be dynamic because these channels will change over time. For some quick actions, it even bundles a widget that shows users some useful information without opening the app.
To continue reading and access the full version of the book, please get the full copy here.