1

This works with standard QR Codes, but however not with a Data Matrix like here.

Nathan Mattes
  • 339
  • 3
  • 11
Pascal
  • 2,590
  • 3
  • 21
  • 46
  • 1
    The reason for this is, that your example doesn't scan for Data Matrix. It only scans for AVMetadataObjectTypeQRCode, AVMetadataObjectTypeEAN8Code, AVMetadataObjectTypeEAN13Code and AVMetadataObjectTypePDF417Code. It should work, if you add `AVMetadataObjectTypeDataMatrixCode`to the `metadataOutput.metadataObjectTypes`-array. – Nathan Mattes Mar 03 '17 at 16:43
  • awesome, thanks a lot! Now it works :) – Pascal Mar 03 '17 at 16:49

1 Answers1

4

The reason for this is, that your example doesn't scan for Data Matrix. It only scans for AVMetadataObjectTypeQRCode, AVMetadataObjectTypeEAN8Code, AVMetadataObjectTypeEAN13Code and AVMetadataObjectTypePDF417Code. It should work, if you add AVMetadataObjectTypeDataMatrixCode to the metadataOutput.metadataObjectTypes-array.

Here you find a list of the machine readable object types you can scan for with AVFoudation.

Nathan Mattes
  • 339
  • 3
  • 11