title: iOS - is Motion Activity Enabled in Settings > Privacy > Motion Activity
body: <p>If an app requires access to <code>Motion Activity</code> data it asks the user at install. However if the user accidentally answers 'No', then the app will not work.</p>
  
  <p>I am looking for a way to check if the Motion Activity is enabled, so that I can prompt the user to enable if not.</p>
  
  <p>Can someone point me in the right direction code wise please? </p>
  
  <hr>
  
  <p>Following the info from Doc (Thank you), it seems that Apple do not provide a direct method to check the status of <code>Motion Activity</code> in Privacy. I was able to find out by picking up on the error:-</p>
  
  <pre><code>[stepCounter queryStepCountStartingFrom:[NSDate date]
                                       to:[NSDate date]
                                  toQueue:[NSOperationQueue mainQueue]
                              withHandler:^(NSInteger numberOfSteps, NSError *error) {
                                  if (error != nil &amp;&amp; error.code == CMErrorMotionActivityNotAuthorized) {
                                      // The app isn't authorized to use motion activity support.
  }
  </code></pre>