From d7e950a3d16ce86da9cb499092056fc4343b098a Mon Sep 17 00:00:00 2001 From: Mahendra Nimishakavi Date: Wed, 29 Nov 2017 12:55:43 +0530 Subject: [PATCH] remove code related to iOS 11 and changed navigation for Safariviewcontroller to show done button for all versions of iOS --- .../models/MASBrowserBasedAuthentication.m | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/MASFoundation/Classes/models/MASBrowserBasedAuthentication.m b/MASFoundation/Classes/models/MASBrowserBasedAuthentication.m index 56efa02a..1b759628 100644 --- a/MASFoundation/Classes/models/MASBrowserBasedAuthentication.m +++ b/MASFoundation/Classes/models/MASBrowserBasedAuthentication.m @@ -207,24 +207,15 @@ -(void)launchBrowserWithURL:(NSURL*)templatizedURL __block MASBrowserBasedAuthentication *blockSelf = self; __weak __typeof__(self) weakSelf = self; blockSelf.safariViewController = [[SFSafariViewController alloc] initWithURL:templatizedURL]; - - if (@available(iOS 11.0, *)) { - blockSelf.safariViewController.dismissButtonStyle = SFSafariViewControllerDismissButtonStyleCancel; - } - else { - // Fallback on earlier versions - } - blockSelf.safariViewController.delegate = weakSelf; - - __block UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:blockSelf.safariViewController]; + blockSelf.safariViewController.delegate = weakSelf; dispatch_async(dispatch_get_main_queue(), ^{ [UIAlertController rootViewController].modalTransitionStyle = UIModalTransitionStyleCoverVertical; - [[UIAlertController rootViewController] presentViewController:navigationController animated:YES + [[UIAlertController rootViewController] presentViewController:blockSelf.safariViewController animated:YES completion:^{ - navigationController = nil; + DLog(@"Successfully displayed login template"); }]; return;