What is it? ● Force Touch is a technology developed by Apple Inc. in 2008, unveiled on September 9, 2014 during the Apple Watch reveal ● Force Touch is a pressure sensitive multi-touch technology that enables trackpads and touchscreens to distinguish between different levels of force being applied to their surfaces ● 3D Touch works by using capacitive sensors that measure microscopic changes in the distance between the backlight and the cover glass. 2
Adding static actions cont’d ● UIApplicationShortcutItemSubtitle An optional string displayed below the title. ● UIApplicationShortcutItemIconType Optional string for a system icon ● UIApplicationShortcutItemUserInfo Optional dictionary with any additional information 6
Icons for Home Screen Quick Actions ● Add icon templates for each shortcut to the asset file ● These icons a single colour with sizes ○ 35x35 @1 ○ 70x70 @2 ○ 105x105 @3 8
Force Properties In your view controller override these methods and check the first UITouch object func touchesBegan(touches: Set, withEvent event: UIEvent?) func touchesMoved(touches: Set, withEvent event: UIEvent?) { if let touch : UITouch? = touches.first { let maximumPossibleForce : CGFloat = touch.maximumPossibleForce let force : CGFloat = touch.force let forcePercentage : CGFloat = force / maximumPossibleForce } } If you support < 9.0 use if #available 18
Simulator support From the horse’s mouth With Xcode 7.0 you must develop on a device that supports 3D Touch. Simulator in Xcode 7.0 does not support 3D Touch. In the wild https://github.com/Flipboard/FLEX https://github.com/DeskConnect/SBShortcutMenuSimulator ^ These use private API’s. Please remove them from your release builds 19