Merge pull request #59 from MaicolBen/fix-zbar-never-closing

Fix scanner never closing
This commit is contained in:
Jacob 2016-04-19 10:04:08 -04:00
commit 92bd015fec

View File

@ -83,7 +83,7 @@
//[self.scanReader.view addSubview:polygonView]; //[self.scanReader.view addSubview:polygonView];
} }
[self.viewController presentModalViewController: self.scanReader animated: YES]; [self.viewController presentViewController:self.scanReader animated:YES completion:nil];
} }
} }
@ -100,6 +100,7 @@
- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
{ {
if ([self.scanReader isBeingDismissed]) { return; }
id<NSFastEnumeration> results = [info objectForKey: ZBarReaderControllerResults]; id<NSFastEnumeration> results = [info objectForKey: ZBarReaderControllerResults];
ZBarSymbol *symbol = nil; ZBarSymbol *symbol = nil;
for(symbol in results) break; // get the first result for(symbol in results) break; // get the first result