I'm looking for code which help me to convert QRCode from image. there is very easy way with AVFoundation
to scan QR Code with help of camera. But if I want to get encoded qr string from UIImage is there any way to do so?
Native solution:
As far as I know you can scan QR from video since iOS 7. (See other answers)
But scanning from image appeared only in iOS 8.
See CIQRCodeFeature
and this shinobicontrols tutorial
third party libs:
For example ZBar
CIDetector* detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:@{CIDetectorAccuracy:CIDetectorAccuracyHigh}];
if (detector) {
NSArray* featuresR = [detector featuresInImage:scannedImg.CIImage];
NSString* decodeR;
for (CIQRCodeFeature* featureR in featuresR) {
NSLog(@"decode %@ ",featureR.messageString);
decodeR = featureR.messageString;
}
}
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