Search code examples
iossafariios9

How to push SFSafariViewController?


2 strange things happen when I try to push Safari ViewController:

  1. Its adress bar with Done button is placed below my Navigation Bar;

  2. Delegate method safariViewControllerDidFinish: does not get called when I press back button.

I don't think Apple would approve of this behavoir, so:

Is there a way to push Safari ViewController without these problems?


Solution

  • Do not push a SFSafariViewController with the pushViewController:animated: method, instead, use the presentViewController:animated:completion: method.

    The Safari view controller will be presented with a standard push animation.