Skip to main content

Aila_ReleaseCamera

Since 3.0.0

Take full control of device camera.

Signature​

void Aila_ReleaseCamera(void (^onCompletion)(void));

Parameters​

  • onCompletion - Block/closure called when camera is ready to use

Description​

Releases the Apple device camera from Aila SDK control for use cases where third-party SDKs or other non-Aila functions require control of the camera. This is an asynchronous call: the camera is not ready to use until the onCompletion block is invoked.

Because AVCaptureSession interacts with the main thread, this function should be called as an asynchronous operation off of the main thread to ensure deadlock does not occur.

Barcode scanning is disabled while Aila_ReleaseCamera() is in effect.

Usage​

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
Aila_ReleaseCamera(^{
NSLog(@"Camera released and ready for use");

// Now you can use the camera for other purposes
[self setupCustomCameraSession];
});
});

See Also​