Skip to content

Instantly share code, notes, and snippets.

@jonathan-beebe
Created November 11, 2015 13:16
Show Gist options
  • Save jonathan-beebe/a370ad797f80e7727793 to your computer and use it in GitHub Desktop.
Save jonathan-beebe/a370ad797f80e7727793 to your computer and use it in GitHub Desktop.
Use hidden SFSafariViewController
private func showHiddenSafariViewController(controller:SFSafariViewController) {
controller.view.userInteractionEnabled = false
controller.view.alpha = 0.0
self.addChildViewController(controller)
self.view.addSubview(controller.view)
controller.didMoveToParentViewController(self)
controller.view.frame = CGRectZero
}
private func removeHiddenSafariViewController(controller:SFSafariViewController) {
controller.willMoveToParentViewController(nil)
controller.view.removeFromSuperview()
controller.removeFromParentViewController()
}
@saturngod
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment