Skip to content

Instantly share code, notes, and snippets.

@prafullakumar
Created June 21, 2020 15:39
Show Gist options
  • Save prafullakumar/d7d126fc8d80038562b18319b5d81b4a to your computer and use it in GitHub Desktop.
Save prafullakumar/d7d126fc8d80038562b18319b5d81b4a to your computer and use it in GitHub Desktop.
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