Https://github.com/bmorton/ZBarSDK
I'm using the Zbar QR code to scan the other SDK can also
The first is to import the library file:
1.avfoundation.framework
2.coremedia.framework
3.corevideo.framework
4.quartzcore.framework
5.libiconv.dylib
This 5 library file
Import #import "ZBarSDK.h" in ViewController.h and inherit <ZBarReaderDelegate> protocol
@property (Weak, nonatomic) Iboutlet Uiimageview *imageview;-(ibaction) Scan: (ID) sender; @property (weak, nonatomic) Iboutlet UILabel *label;
Uiimageview/uilabel/uibutton, Uiimageview used to display scanned images, UILabel used to display the information scanned, UIButton for responding to events
-(ibaction) Scan: (ID) Sender { Zbarreaderviewcontroller * reader = [Zbarreaderviewcontroller new]; Reader.readerdelegate = self; Zbarimagescanner * scanner = Reader.scanner; [Scanner setsymbology:zbar_i25 config:zbar_cfg_enable to:0]; Reader.showszbarcontrols = YES; [Self Presentviewcontroller:reader animated:yes completion:nil]; } -(void) Imagepickercontroller: (Uiimagepickercontroller *) Picker Didfinishpickingmediawithinfo: (NSDictionary *) info { id<nsfastenumeration> results = [info objectforkey:zbarreadercontrollerresults]; Zbarsymbol * symbol; for (symbol in results) break ; _imageview.image = [info objectforkey:uiimagepickercontrolleroriginalimage]; [Picker Dismissviewcontrolleranimated:yes Completion:nil];
iOS QR code scan