Created
January 7, 2017 00:41
-
-
Save danielCarlosCE/97d534f1c076f8d67a6856bbdf873389 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func isCodeInLimitBounds(codeReadable: AVMetadataMachineReadableCodeObject) -> Bool { | |
if let videoLayer = previewLayer as? AVCaptureVideoPreviewLayer, | |
let transformedObj = videoLayer.transformedMetadataObject(for: codeReadable), | |
let limitBounds = limitBounds { | |
return limitBounds.contains(transformedObj.bounds) | |
} | |
//ignore 'failure' above | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment