From 1625c4fe027c19dbb2f8e1aa6b74dbe4d753aebd Mon Sep 17 00:00:00 2001 From: MaicolBen Date: Mon, 4 Apr 2016 15:08:01 -0300 Subject: [PATCH] Fix scanner never closing --- ios/CsZBar.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/CsZBar.m b/ios/CsZBar.m index a7a61f7..9d28c35 100644 --- a/ios/CsZBar.m +++ b/ios/CsZBar.m @@ -83,7 +83,7 @@ //[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 { + if ([self.scanReader isBeingDismissed]) { return; } id results = [info objectForKey: ZBarReaderControllerResults]; ZBarSymbol *symbol = nil; for(symbol in results) break; // get the first result