0

On iOS 7 the user can choose disable device motion in Settings -> General -> Accessibility -> Reduce Motion.

I am creating a UI effect based on UITableView scrolling, so I am not using CMMotionManager or the CoreMotion framework to create any motion effects.

However, I would like to respect the user's settings and not create the motion effect if the user has turned on Reduce Motion in Settings.

CMMotionManager includes an instance method deviceMotionActive to check for whether it's active (I'm assuming this is the correct check), however, I'd prefer not having to initialize the manager just to do this check, sadly I cannot find any documentation about a class method that would return a similar boolean, sort of like there exist class methods on MFMessageComposeViewController to check for iMessage/SMS availability (+(BOOL)canSendText) and so on.

Thanks!

runmad
  • 14,846
  • 9
  • 99
  • 140
  • @MatiasForbord This is not the same question. This question pertains to reduced motion of the device's animation effects (such as app launching animations, effects for UIAlertView overlay and the home screen wallpaper moving when tilting the device) not whether the motion activity recorded by the device can be viewed by 3rd party apps. – runmad Apr 01 '14 at 23:52
  • Yes, you're right - it was not a duplicate. Determining what you thought you needed was accomplished in an answer in that question, though. Too bad there's no way you can figure out the setting you need yet! – Matias Forbord Apr 05 '14 at 19:47

1 Answers1

0

You are confusing two separate things called "motion". CMMotionManager is used to access the sensors, such as the gyroscope and accelerometer, that report how a user physically moves a device. It has nothing to do with the motion effects, like UIMotionEffect objects, that are used in animating views.

The deviceMotionActive method merely indicates whether your app is currently registered for receiving motion updates from CoreMotion. This will only be true if your app has called one of the CMMotionManager startXXXUpdate methods. Again, it has nothing to do with user settings or UIMotionEffect objects.

UPDATE: As John mentions in the comments, there appears to be an API for this in iOS 8: See stackoverflow.com/a/25453082/2904769 .

SwampThingTom
  • 891
  • 1
  • 6
  • 15
  • Thanks for pointing me in the right direction. I looked at the `UIMotionEffect` library too, earlier, nothing there either. – runmad Dec 11 '13 at 21:26
  • 1
    See http://stackoverflow.com/a/25453082/2904769 . There's an API for this in iOS 8. – John Scalo Aug 22 '14 at 18:07