Last active
August 29, 2015 14:06
-
-
Save iGriever/f0b00ff3cac2e2b0a0d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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