Join Tammy Coron for an in-depth discussion in this video Using peek quick actions, part of iOS 9 3D Touch In Depth.
- View Offline
- [Voiceover] Providing your users with peek quick actions…is another way to extend your app's usability.…The two classes you will use to create these actions…are UIPreviewAction and UIPreviewActionGroup.…You'll also use UIPreviewActionItemProtocol.…This is the protocol that defines the styles…and the read-only accessor for the title property…for UIPreviewAction and UIPreviewGroup.…Let's see how these work in code.…For this demo, we'll be using the 3DTouch-Example project…included with the exercise files for this chapter.…
In the detail view controller,…you can see that I'm creating a preview actions array…and inside of this array,…I'm creating several different actions.…Here are the first two, these are standard actions.…I'm using the UIPreviewAction class in defining a title…and a style.…The title here is default action and the style is default.…I'm creating another action here,…a destructive action and I'm setting the title…to be destructive action and the style to be destructive.…
I then have a helper function down here.…
In this course, Tammy Coron walks through the 3D Touch API. She shows how to add static and dynamic quick actions, which allow you to display shortcuts for app-specific tasks. She also covers peek—for displaying live previews of items—and pop, which opens a detailed version of the peek view. Last but not least, she shows how to implement custom actions using UITouch's new properties: force and maximumPossibleForce.
- Accessibility and 3D Touch
- Checking for 3D Touch availability
- Understanding static vs. dynamic actions
- Working with peek and pop views
- Working with UITouch objects