Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

FIX: adden swipe cancel issue in ios 13 devices #869

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ios/CDVBarcodeScanner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ @interface CDVbcsViewController : UIViewController <CDVBarcodeScannerOrientation
@property (nonatomic, retain) UIView * reticleView;
// unsafe_unretained is equivalent to assign - used to prevent retain cycles in the property below
@property (nonatomic, unsafe_unretained) id orientationDelegate;
@property (nonatomic, getter=isModalInPresentation) BOOL modalInPresentation;

- (id)initWithProcessor:(CDVbcsProcessor*)processor alternateOverlay:(NSString *)alternateXib;
- (void)startCapturing;
Expand Down Expand Up @@ -351,13 +352,16 @@ - (void)scanBarcode {
self.viewController = [[CDVbcsViewController alloc] initWithProcessor: self alternateOverlay:self.alternateXib];
// here we set the orientation delegate to the MainViewController of the app (orientation controlled in the Project Settings)
self.viewController.orientationDelegate = self.plugin.viewController;

if (@available(iOS 13.0, *)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it work the same with the new iPad OS

Copy link

@swatbtc swatbtc Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It will work.

self.viewController.modalInPresentation = YES;
}
// delayed [self openDialog];
[self performSelector:@selector(openDialog) withObject:nil afterDelay:1];
}

//--------------------------------------------------------------------------
- (void)openDialog {
[self.viewController setModalPresentationStyle:UIModalPresentationFullScreen];
[self.parentViewController
presentViewController:self.viewController
animated:self.isTransitionAnimated completion:nil
Expand Down