Join Tammy Coron for an in-depth discussion in this video Checking for availability, part of iOS 9 3D Touch In Depth.
- [Voiceover] As mentioned previously, not all devices…are 3D Touch-enabled, and even the ones that are,…users can disable this features.…Disabling 3D Touch on a 3D Touch-enabled device…is done by using the toggle switch in the settings app.…This is located within the accessibility options.…As a developer, it's your responsibility…to check if 3D Touch is enabled.…To do this, you'll use the value stored in…traitCollection.forceTouchCapability.…
If it's not available, you can either ignore the command…or present a message to the user.…Because users can go into their settings…and disable or enable 3D Touch while your app is running,…it's important to check this value…in traitCollectionDidChange.…If you plan to support 3D Touch, remember,…not all devices have 3D Touch capability.…In those situations, it's recommended that you use…UILongPressGestureRecognizer to mimic…the 3D Touch actions.…
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