// 1.創立掃描器
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:nil];
// 2.掃描後果
CIImage *ciImage = [[CIImage alloc] initWithImage:image];
NSArray *features = [detector featuresInImage:ciImage];
// 3.遍歷掃描後果
for (CIQRCodeFeature *f in features) {
// 假如是網址就跳轉
if ([f.messageString containsString:@"http://"] || [f.messageString containsString:@"https://"] ) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:f.messageString]];
}else{ // 其他信息 彈框顯示
[self showHint:f.messageString];
}
}
//保管圖片
UIImageWriteToSavedPhotosAlbum(_quarCodeImageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
【iOS,二維碼辨認,保管二維碼】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!