Created
June 21, 2020 15:39
-
-
Save prafullakumar/d7d126fc8d80038562b18319b5d81b4a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 createCIImage() -> CIImage? { | |
guard let filter = CIFilter(name: "CIQRCodeGenerator") else { | |
return nil | |
} | |
filter.setDefaults() | |
filter.setValue(url.data(using: String.Encoding.ascii), forKey: "inputMessage") | |
filter.setValue("H", forKey: "inputCorrectionLevel") | |
//https://www.qrcode.com/en/about/error_correction.html | |
return filter.outputImage | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment