@IBOutlet weak var textTextField: UITextField! @IBOutlet weak var text2TextField: UITextField! @IBOutlet weak var QRImage: UIImageView! @IBAction func convertButton(_ sender: Any) { if let myString = textTextField.text { let data = myString.data(using: .ascii, allowLossyConversion: false) let data2 = myString.data(using: .ascii, allowLossyConversion: false) let filter = CIFilter(name : "CIQRCodeGenerator") filter?.setValue(data, forKey: "inputMessage") filter?.setValue(data2, forKey: "inputMessage") let img = UIImage(ciImage: (filter?.outputImage)!) QRImage.image = img } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)