Is there a standard way to generate a QR code and attach it to a mail item from iOS client app (no server code)?
While there is no built-in tool to create a QR code on iOS, plenty of third-party apps are available that can do the job. We'll be using the free QRbot app. You could also use any other popular QR Reader app since they usually come with features that let you make your own QR codes.
Tap Icon Size, then choose 128X128p or Custom, then manually type the height and height of the logo or image file in the QR code. Tap on Create button at the bottom, the custom QR code with logo, signature or image in the middle will be created instantly.
Yes, you can create a QR code for a picture using QRTIGER QR code generator online by following the instructions above.
Since iOS 7, you can use a Core Image filter to generate QR images. See the final tip here:
- (CIImage *)createQRForString:(NSString *)qrString { NSData *stringData = [qrString dataUsingEncoding: NSISOLatin1StringEncoding]; CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"]; [qrFilter setValue:stringData forKey:@"inputMessage"]; return qrFilter.outputImage; }
For Obj-C version that perfectly works for me, I've mixed answers पवन and Teja Kumar Bethina:
NSString *qrString = @"My string to encode"; NSData *stringData = [qrString dataUsingEncoding: NSUTF8StringEncoding]; CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"]; [qrFilter setValue:stringData forKey:@"inputMessage"]; [qrFilter setValue:@"H" forKey:@"inputCorrectionLevel"]; CIImage *qrImage = qrFilter.outputImage; float scaleX = self.qrImageView.frame.size.width / qrImage.extent.size.width; float scaleY = self.qrImageView.frame.size.height / qrImage.extent.size.height; qrImage = [qrImage imageByApplyingTransform:CGAffineTransformMakeScale(scaleX, scaleY)]; self.qrImageView.image = [UIImage imageWithCIImage:qrImage scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With