NSCameraUsageDescription in iOS 10.0 runtime crash?

After iOS 10 you have to define and provide a usage description of all the system’s privacy-sensitive data accessed by your app in Info.plist as below: Calendar Key : Privacy – Calendars Usage Description Value : $(PRODUCT_NAME) calendar events Reminder : Key : Privacy – Reminders Usage Description Value : $(PRODUCT_NAME) reminder use Contact : … Read more

Detect permission of camera in iOS

Check the AVAuthorizationStatus and handle the cases properly. NSString *mediaType = AVMediaTypeVideo; AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType]; if(authStatus == AVAuthorizationStatusAuthorized) { // do your logic } else if(authStatus == AVAuthorizationStatusDenied){ // denied } else if(authStatus == AVAuthorizationStatusRestricted){ // restricted, normally won’t happen } else if(authStatus == AVAuthorizationStatusNotDetermined){ // not determined?! [AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) { … Read more