0

In iPhone 6S, from settings/Accessibility/3D Touch user can able to enable/disable 3D touch option. I have tried UIForceTouchCapabilityto find out 3D touch enable or disable..

typedef NS_ENUM (NSInteger,
   UIForceTouchCapability ) {
   UIForceTouchCapabilityUnknown = 0,
   UIForceTouchCapabilityUnavailable = 1,
   UIForceTouchCapabilityAvailable = 2
};

on iPhone 6S and 3D Enable = `UIForceTouchCapabilityAvailable`
on iPhone 6S and 3D Disable = `UIForceTouchCapabilityUnavailable `
on iphone 6 = `UIForceTouchCapabilityUnavailable`

Is there any way to check, to find out 3D touch enable/disable from settings/Accessibility/3D Touch using objective C or Swift.

Shohrab
  • 546
  • 6
  • 21
  • I think what you are looking for is trait collection. take a look at this so answer - http://stackoverflow.com/questions/32814383/check-if-3d-touch-is-supported-and-enabled-on-the-ios9-device – Rufus Feb 23 '16 at 17:21
  • i have check this but its not work as for iphone 6 & iphone 6s with disable 3d touch response UIForceTouchCapabilityUnavailable .. – Shohrab Feb 23 '16 at 17:39
  • I would recommend you to abstract your code from determining the exact device model. If you got `UIForceTouchCapabilityUnavailable` from the check, it does not matter what model of the device the app is running at. As Apple advises: Rely on capabilities, not on the device model. – Yevhen Dubinin May 28 '16 at 14:46

1 Answers1

0

I think you have answered your question yourself.

If you want to find if a device with 3D touch capability has it turned OFF in settings, you can just find which device it is and manage if it returns UIForceTouchCapabilityUnavailable it means it is disabled in settings.

ShayanK
  • 1,243
  • 2
  • 13
  • 27