I have this code to generate a barcode:
func generateBarcode(from string: String) -> UIImage?
{
let data = string.data(using: String.Encoding.ascii)
if let filter = CIFilter(name: "CICode128BarcodeGenerator")
{
filter.setValue(data, forKey: "inputMessage")
let transform = CGAffineTransform(scaleX: 3, y: 3)
if let output = filter.outputImage?.transformed(by: transform)
{
return UIImage(ciImage: output)
}
}
return nil
}
I need to generate a code39 barcode. I have not found an equivalent for "CICode128BarcodeGenerator" for Code 39.
How can I modify this code for code 39?
thanks
If I'm reading the Apple Documentation correctly these are the types they encode: