Create QR code in iphone

2019-02-20 20:58发布

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?

2条回答
2楼-- · 2019-02-20 21:50

Yes, It's Possible. There are two Best Libraries available :

1) For Encoding : QR-Code-Encoder-for-Objective-C

2) For Decoding : ZBar bar code reader

GoodLuck.

查看更多
孤傲高冷的网名
3楼-- · 2019-02-20 21:53

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.

查看更多
登录 后发表回答