title: My application has the camera access permission by default.How can i turned it off and ask for permission?
body: <p>I am using camera in my application, and i want to ask for that trendy permission which every other app prompts. How can i get that ? </p>
  
  <pre><code>AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
  if(authStatus == AVAuthorizationStatusAuthorized) {
      // do your logic
      authorized = YES;
       [self actionLaunchAppCamera];
  
  } else if(authStatus == AVAuthorizationStatusDenied){
      // denied
      authorized = NO;
  
  } else if(authStatus == AVAuthorizationStatusRestricted){
      // restricted, normally won't happen
  } else if(authStatus == AVAuthorizationStatusNotDetermined){
      // not determined?!
      [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
          if(granted){
              NSLog(@"Granted access to %@", AVMediaTypeVideo);
  
  
  
          } else {
              NSLog(@"Not granted access to %@", AVMediaTypeVideo);
          }
      }];
  } else {
      // impossible, unknown authorization status
  }
  </code></pre>
  
  <p>I am using the above code for checking authorization but it always go inside authorizedstatus condition as it has the permission already. I have checked from privacy settings the permission is already on. But i have never ask for the permission from user.</p>
  
  <p>Thanks everyone.</p>