Incept Development

{application software design and development}

Machine Readable Code and Face Recognition Example iOS 7

Pre iOS 7 if we wanted to scan machine readable codes i.e. QR Codes, Bar Codes etc. we had to rely on 3rd party C++ libraries. Even though libraries like ZXing are great they are still an overload, hard to compile, and require refractoring for every new iOS. With iOS 7 Apple has added the ability to extract metadata from machine readable codes directly to AVFoundation. Ivan Djeferov has written a great example which can be used to scan QRCode metadata and Face Recognition. It really boils down to reading output from:

#pragma mark - AVMetadataObjectsDelegate

- (
void)captureOutput:(AVCaptureOutput *)captureOutput
NSArray *)metadataObjects
AVCaptureConnection *)connection
for (AVMetadataMachineReadableCodeObject *avmmrco in metadataObjects)
id callback = ^()
if (self.didRecognizeMetadataObject)
self.didRecognizeMetadataObject (self,

if (!self.callbackQueue)
dispatch_async(dispatch_get_main_queue(), callback);
dispatch_async(self.callbackQueue, callback);

Apple allows up to 4 metadata objects at the same time. If machine readable codes are detected it will output an array with metadata objects of type: AVMetadataMachineReadableCodeObject. Those contain stringValue, codeType, bounds and corners. You can download Xcode example below:

Download Machine Readable Code and Face Recognition Example iOS 7

The code requires advanced iOS programming knowledge. It is based on:

Camera Overlay:

AVFoundation Example:

Dec 2013
Sep 2013
©2013 Incept Development Contact Us