Skip to content

Commit c31fb64

Browse files
committed
When setting metadata object types, only use supported types
1 parent 7404034 commit c31fb64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

camera/CameraManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ open class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate, UIGest
822822

823823
// Note: The object types must be set after the output was added to the capture session.
824824
output.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)
825-
output.metadataObjectTypes = [.qr, .ean8, .ean13, .pdf417]
825+
output.metadataObjectTypes = [.qr, .ean8, .ean13, .pdf417].filter { output.availableMetadataObjectTypes.contains($0) }
826826
}
827827

828828
/**

0 commit comments

Comments
 (0)