Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push SFSafariViewController?

Tags:

ios

ios9

safari

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?

like image 959
Yaroslav Avatar asked Sep 16 '15 09:09

Yaroslav


People also ask

Does SFSafariViewController share cookies?

Cookies. In iOS9, cookies between the Safari system browser and the SFSafariViewController are only shared if they are persistent. Session cookies are not shared and can result in different authentication sessions between the system browser and the Safari view controller.

What is Safari view controller?

The view controller includes Safari features such as Reader, AutoFill, Fraudulent Website Detection, and content blocking. In iOS 9 and 10, it shares cookies and other website data with Safari.


1 Answers

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.

like image 124
0xced Avatar answered Sep 21 '22 09:09

0xced