Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm developing an application in swift that can create barcode.but my problem is that when i want to create barcode for 2textfield such as EmailAddress type of barcode i can not add two filters to it.im very new in swift can any body help me?
Swift
@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
    }
}


What I have tried:

i tried above code but the second filter doesn't work
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900