2

I'm presenting SFSafariViewController on app, but on Landscape doesn't fit the screen, also done/back button doesn't work - freezing. The controller is presenting as modal. When presenting full screen it works as it should. Is any option for showing SFSafariViewController full screen on modal controllers.

enter image description here

  guard let webUrl = NSURL(string: url) else { return }
    let safariVC = SFSafariViewController(url: webUrl as URL)
    restrictRotation(true)
    self.present(safariVC, animated: true, completion: nil)
    safariVC.delegate = self

-(void) restrictRotation:(BOOL) restriction {
    AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
    appDelegate.shouldRotate = restriction;
}

App delegate:

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if (self.shouldRotate) {
    return UIInterfaceOrientationMaskAll;
} else {
    return UIInterfaceOrientationMaskPortrait;
}

}

Vadim Nikolaev
  • 2,132
  • 17
  • 34
pajtimid
  • 518
  • 1
  • 4
  • 13

0 Answers0