motion/core/ios/device.rb in bubble-wrap-1.9.5 vs motion/core/ios/device.rb in bubble-wrap-1.9.6

- old
+ new

@@ -51,9 +51,17 @@ !(UIDevice.currentDevice.model =~ /simulator/i).nil? end end end + def force_touch? + if defined?(UIForceTouchCapabilityAvailable) && defined?(UIScreen.mainScreen.traitCollection) && defined?(UIScreen.mainScreen.traitCollection.forceTouchCapability) + UIScreen.mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable + else + false + end + end + # Returns the IOS SDK version currently running (i.e. "5.1" or "6.0" etc) # @return [String] the IOS SDK version currently running def ios_version UIDevice.currentDevice.systemVersion end