title: Crash requesting authorisation to Photos Library in iOS 10
body: <p>I have a sample iOS 10 application requesting authorisation to the Photos Library and crashing on a real device with the following crash error:</p>
  
  <p><code>PhotosAuthorizationCrashTest[2014:42551] [access] &lt;private&gt;</code></p>
  
  <p>The repo can be found <a href="https://github.com/Eddpt/PhotosAuthorizationCrashTest" rel="nofollow">here</a></p>
  
  <p>Here's the code that requests authorisation (Swift 3.0):</p>
  
  <pre><code>private func requestAuthorizationIfNeeded() {
      DispatchQueue.main.async {
          let status = PHPhotoLibrary.authorizationStatus()
          if status == .authorized {
              return
          }
  
          PHPhotoLibrary.requestAuthorization({ (status) in
              if status == .authorized {
                  return
              }
  
              NSLog("Could not get authorization to access photos")
          })
      }
  }
  </code></pre>