Open jaydenhe opened 7 years ago
my work around was to draw the qrImage in context then save from there.
let QRImage = QRCode.generateImage(qrString, avatarImage: nil, color: CIColor.init(red: 0.99, green: 0.27, blue: 0.12), backColor: CIColor.init(red: 1.0, green: 1.0, blue: 1.0, alpha: 0.0))
UIGraphicsBeginImageContext(CGSize(width: 360, height: 360))
QRImage?.draw(in: CGRect(x: 0, y: 0, width: 360, height: 360))
let contextImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
data = UIImagePNGRepresentation(contextImage);
UIImagePNGRepresentation always return nil
by the way: qrImageView.image = QRCode.generateImage(Token.base64EncodedString(), avatarImage:nil)
if let qrImage = qrImageView.image { let vc = UIActivityViewController(activityItems: [qrImage] as [Any], applicationActivities: [])
self.present(vc, animated: true, completion: nil) } I cant share the QRCode