- 论坛徽章:
- 0
|
- + (BOOL)isAVCaptureActive
- {
- AVCaptureDevice *aDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
-
- NSError *inputError = nil;
- AVCaptureDeviceInput *aInput = [AVCaptureDeviceInput deviceInputWithDevice:aDevice error:&inputError];
-
- if (aInput == nil)
- {
- SYLog(@"init AVCapture fail--%@",inputError);
-
- return NO;
- }
-
- return YES;
- }
-
- if(isAVCaptureActive)
- {
- SYQRCodeViewController *syqrc = [[SYQRCodeViewController alloc] init];
- syqrc.SYQRCodeSuncessBlock = ^(NSString *qrString){
- self.saomiaoLabel.text = qrString;
- };
-
- syqrc.SYQRCodeCancleBlock = ^(SYQRCodeViewController *aqrc){
- self.saomiaoLabel.text = @"扫描取消~";
- [aqrc dismissViewControllerAnimated:YES completion:nil];
- };
- [self presentViewController:syqrc animated:YES completion:nil];
- }
复制代码
|
|