0

I have a UINavigationController presented in a .pageSheet style, which may contain a SFSafariViewController. Other ViewControllers presented in the UINavigationController automatically handle the pull-to-dismiss interaction, but SFSafariViewController doesn't in this case (even though when presented by itself, it does it for itself). Any ideas on how to get this working?

Example (sorry for the mixing of Obj-C and swift):

SFSafariViewController *safariVC = [[SFSafariViewController alloc] initWithURL:url];
safariVC.modalPresentationStyle = UIModalPresentationPageSheet;

// elsewhere

let navigationContainer = UINavigationController(rootViewController: safariVC)
navigationContainer.modalPresentationStyle = .pageSheet
parentVC.present(navigationContainer, animated: animated)
David Liu
  • 9,426
  • 5
  • 40
  • 63
  • Can you provide your code so we can help diagnose the issue? – Chase Smith Mar 17 '20 at 23:27
  • Added an example. There's not much to it though. – David Liu Mar 17 '20 at 23:56
  • There is no problem with pull-to-dismiss, it works as expected if you pull it down from navigation bar. But if you try to pull from in the middle of the webview touching gesture will be handled by webview, so it won't be dimissed. It will scroll the current web page. – Okan Kocyigit Mar 18 '20 at 00:13
  • @ocanal Well, yeah. That's the behavior I want to fix. A ViewController containing a WKWebView actually works fine with this behavior, but a SFSafariViewController does not. – David Liu Mar 18 '20 at 00:16
  • It seems to be `SFSafariViewController ` is sandboxed. So we can't disable user interaction like scrolling or tapping etc. – Okan Kocyigit Mar 18 '20 at 00:38

0 Answers0