Skip to content

Instantly share code, notes, and snippets.

@iGriever
Last active August 29, 2015 14:06
Show Gist options
  • Save iGriever/f0b00ff3cac2e2b0a0d4 to your computer and use it in GitHub Desktop.
Save iGriever/f0b00ff3cac2e2b0a0d4 to your computer and use it in GitHub Desktop.
// Camera permission handling - iOS 8
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted){
if (granted)
{
dispatch_sync(dispatch_get_main_queue(), ^{
// Present camera controller here
});
}
else
{
dispatch_sync(dispatch_get_main_queue(), ^{
// Handle denied permission here (error message, UI update, etc.)
});
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment