Join Tammy Coron for an in-depth discussion in this video Creating dynamic quick actions, part of iOS 9 3D Touch Quick Start.
- [Voiceover] Creating dynamic quick actions…is a bit different than creating static quick actions.…With dynamic quick actions,…you create them completely in code…using the UIMutableApplicationShortcutItem class.…There are only a few properties in this class.…Just like with static actions,…you can define the title, subtitle,…type, icon, and user info.…In this short snippet of code,…I'm creating two additional items.…
Both are Dynamic Quick Actions…and will appear after my static actions.…If at any point I need to modify these actions,…I can do so simply by updating the value stored…in ShortcutItems.…Let's take a look at this in code.…For this demo, we'll be using the 3DTouch-Example project…included with the exercise files for this chapter.…In the AppDelegate.swift, under the function…application didfinishLaunching,…that's where I'm adding my new dynamic quick actions.…
That begins here on line 53.…You can see here on line 55,…this is where I create my new item called item3…using the UIMutableApplicationShortcutItem class.…
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