0

I'm pushing SFSafariViewController into UITabBarController. But clicking on the Safari Done button dismisses the UITabBarController. How to prevent it?

Kaushik Makwana
  • 1,329
  • 2
  • 14
  • 24

1 Answers1

0

If you are Pushing the SFSafariViewController try popViewController instead of dismiss

self.navigationController?.popViewController(animated: true)

Or you can present the SFSafariViewController instead of pushing it

safariViewController.modalTransitionStyle = .crossDissolve
safariViewController.modalPresentationStyle = .overCurrentContext

self.present(safariViewController, animated: false, completion:nil)
Razi Tiwana
  • 1,425
  • 2
  • 13
  • 16
  • 1. Safari view controller always calls dismiss, I'm not able to avoid it 2. present shows Safari view controller modally, the bottom tab bar is hidden and so no way to switch between bar items – Peter Balogh Apr 19 '19 at 12:54
  • @PeterBalogh Try presenting it `modalPresentationStyle` set to `overCurrentContext ` it will solve your problem. Edited the answer accordingly – Razi Tiwana Apr 19 '19 at 13:16
  • overCurrentContext presentation style helps :-) Unfortunately another problem has been appeared: when safari view is opened, I switch to another bar item view, than I switch back to safari view and I close it, than the current view is not showed, the tab is empty. I have to switch to another bar item, than switch back to show a view. – Peter Balogh Apr 19 '19 at 14:15