Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed iOS 13 openURL crash #752

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions extras/QWebElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ - (void)selected:(QuickDialogTableView *)tableView controller:(QuickDialogContro
if ([_url hasPrefix:@"http"] || [_url hasPrefix:@"/"]) {
QWebViewController *webController = [[QWebViewController alloc] initWithUrl:_url];
[controller displayViewController:webController withPresentationMode:self.presentationMode];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:_url]];
} else {
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:_url] options:@{} completionHandler:nil];
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:_url]];
#pragma clang diagnostic pop
}
[tableView deselectRowAtIndexPath:path animated:NO];
}
}
Expand Down
9 changes: 8 additions & 1 deletion extras/QWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ - (void)actionRefresh {
}

- (void)actionGoToSafari {
[[UIApplication sharedApplication] openURL:[_webView.request mainDocumentURL]];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:[_webView.request mainDocumentURL] options:@{} completionHandler:nil];
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[UIApplication sharedApplication] openURL:[_webView.request mainDocumentURL]];
#pragma clang diagnostic pop
}
}

- (void)viewWillAppear:(BOOL)animated {
Expand Down