Skip to content
二维码扫描、生成库,使用AVFoundation
Objective-C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
QRCodeScannerDemo
QRcodeScanner
LICENSE
README.md

README.md

#HLQRCodeViewController ##A QRCode Scanner using AVFoundation

###Usage: 1.Add AVFoundation framework.<br> 2.Add source files.

- (IBAction)captureQRCode:(id)sender {
    HLQRCodeViewController * qrcodeVC = [[HLQRCodeViewController alloc]init];
    qrcodeVC.qrReadSuccess = ^(HLQRCodeViewController *qrVC,NSString *result){
        [qrVC dismissViewControllerAnimated:YES completion:^{
        }];
        self.resultLabel.text = result;
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:result]];
    };
    qrcodeVC.qrReadFailure = ^(HLQRCodeViewController *qrVC){
        [qrVC dismissViewControllerAnimated:YES completion:nil];
        self.resultLabel.text = @"读取失败";
    };
    qrcodeVC.qrReadCancel = ^(HLQRCodeViewController *qrVC){
        [qrVC dismissViewControllerAnimated:YES completion:nil];
        self.resultLabel.text = @"取消读取~";
    };
    [self presentViewController:qrcodeVC animated:YES completion:nil];
}
You can’t perform that action at this time.