This works with standard QR Codes, but however not with a Data Matrix like here.
Asked
Active
Viewed 1,928 times
1

Nathan Mattes
- 339
- 3
- 11

Pascal
- 2,590
- 3
- 21
- 46
-
1The 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 Answers
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