Search code examples
iphoneiosios6qr-code

Create QR code in iphone


I have seen some example codes, these code are creating QR codes froms Text (below is the code).can we generate QR codes from other data also (like Image)?

 NSString *code = @"1001012023034";

Barcode *barcode = [[Barcode alloc] init];

self.view.backgroundColor = [UIColor whiteColor];

[barcode setupQRCode:code];
self.imageView.image = barcode.qRBarcode;

My question is if we use Image instead of string data then is it possible?


Solution

  • QR codes are pretty limited in terms of data storage, limited to a few kb - see http://en.wikipedia.org/wiki/QR_code#Storage for storage sizes. As such, you won't be able to put an image in there. What you CAN do, however, is upload the image somewhere and encode a link to that image instead.