Skip to content

Instantly share code, notes, and snippets.

@rinsuki
Created November 3, 2016 06:31
Show Gist options
  • Save rinsuki/f871af650fd7ca6aabf8a8908809fca0 to your computer and use it in GitHub Desktop.
Save rinsuki/f871af650fd7ca6aabf8a8908809fca0 to your computer and use it in GitHub Desktop.
import objc_util
SFSafariViewController = objc_util.ObjCClass('SFSafariViewController')
safari = SFSafariViewController.alloc().initWithURL_(objc_util.nsurl('http://www.google.com'))
root_vc = objc_util.ObjCClass('UIApplication').sharedApplication().keyWindow().rootViewController()
while root_vc.presentedViewController():
root_vc = root_vc.presentedViewController()
root_vc.presentViewController_animated_completion_(safari,False,None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment