mikebuss/MTBBarcodeScanner — pull request #12 by mikebuss (2014-11-01 20:08:10+00:00)
Title: Request camera permission in iOS 8

Previously, MTBBarcodeScanner would check if scanning was available using a synchronous method. With iOS 8 and the new need to request permission when accessing the camera, the library needs to wait for the user to grant permission before scanning starts.

This pull request would change this:

```objective-c

if ([MTBBarcodeScanner scanningIsAvailableAndAllowed]) {
// The user may or may not have granted access to the camera
// Calling startScanning will fail this time, because we didn't wait for the user to respond
[self startScanning];
} else {
// The user definitely denied permission in the past
// or the device doesn't support scanning
}

```
Into this:

```objective-c

[MTBBarcodeScanner requestCameraPermissionWithSuccess:^(BOOL success) {
if (success) {
// The user granted access to the camera, has granted
// access in the past, or is running iOS 7 where no permission is necessary
[self startScanning];
} else {
// User denied access to the camera
}
}];

```