The scanned control is a view, and the user simply needs to stick it in their own controller. Other UI users can add them at their own controller. The code is as follows
- (void) viewdidload {[Super viewdidload]; //Scan active area (i.e. transparent area within the box)CGRect Interestrect = CGRectMake ( -, (Self.view.frame.size.height-(Self.view.frame.size.width- +))/2.0f, Self.view.frame.size.width- +, Self.view.frame.size.width- +); //Scan Controls_scanview =[[Lfqrcodescanner alloc] InitWithFrame:self.view.bounds Rectofinterest:interestrect]; _scanview.imgline.image= [UIImage imagenamed:@" Line"]; _scanview.scanfilishblock= ^ (Avmetadatamachinereadablecodeobject *result) {NSLog (@"Scan Result:%@", Result.stringvalue); }; [Self.view insertsubview:_scanview Atindex:0];//Place the scan view on the bottom}- (void) Viewwillappear: (BOOL) animated {[Super viewwillappear:animated]; [Self.scanview start];}- (void) Viewdiddisappear: (BOOL) animated {[Super viewdiddisappear:animated]; [Self.scanview stop];}
Source Address: Https://github.com/zhanglinfeng/LFQRCode
Support Cocoapods
Pod ' Lfqrcode ' (recommended)
IOS easy-to-use QR code scan and generate QR code three-party control Lfqrcode, flexible custom UI