diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2016-06-21 16:07:50 +0300 |
---|---|---|
committer | VladiMihaylenko <vxmihaylenko@gmail.com> | 2016-06-21 16:07:50 +0300 |
commit | a7fb93c46c0f902a35a7e7da977ba05d0c5164dd (patch) | |
tree | e86e00564fffe3830a2996fea3fbb1b8bf9bd2ee /iphone | |
parent | 6cc38f886a2af184f93880a6b5bec9d0beac59f2 (diff) |
[ios] Open urls in system safari.
Diffstat (limited to 'iphone')
-rw-r--r-- | iphone/Maps/Categories/UIKitCategories.mm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index 9003883595..31d16587cc 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -344,8 +344,14 @@ - (void)openUrl:(NSURL *)url { + UIApplication * app = [UIApplication sharedApplication]; + if ([app canOpenURL:url]) + [app openURL:url]; + // TODO(Vlad): Correct implementation of navigation controller's buttons. + /* NSString * scheme = url.scheme; - if ((isIOS7 || isIOS8) && (![scheme isEqualToString:@"http"] || ![scheme isEqualToString:@"https"])) + NSAssert(([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]), @"Incorrect url's scheme!"); + if ((isIOS7 || isIOS8)) { UIApplication * app = [UIApplication sharedApplication]; if ([app canOpenURL:url]) @@ -355,6 +361,7 @@ SFSafariViewController * svc = [[SFSafariViewController alloc] initWithURL:url]; svc.delegate = self; [self.navigationController pushViewController:svc animated:YES]; + */ } @end |