Skip to content

Instantly share code, notes, and snippets.

@speaktoalvin
Last active October 29, 2015 06:42
Show Gist options
  • Save speaktoalvin/b8a039ca6b484061546a to your computer and use it in GitHub Desktop.
Save speaktoalvin/b8a039ca6b484061546a to your computer and use it in GitHub Desktop.
// Adding Screen Edge Pan to the presenting viewController
@IBAction func showSafariViewController(sender: AnyObject) {
let safariViewController = IDMSafariViewController(URL: NSURL(string: "http://idreamcode.com")!)
safariViewController.delegate = self;
safariViewController.transitioningDelegate = self.transitionManager
safariViewController.modalPresentationStyle = UIModalPresentationStyle.Custom
self.transitionManager.transitionTo = kToManageReourceVC
self.presentViewController(safariViewController, animated: true) { () -> Void in
let recognizer = UIScreenEdgePanGestureRecognizer(target: self, action: "handleGesture:")
recognizer.edges = UIRectEdge.Left
safariViewController.edgeView?.addGestureRecognizer(recognizer)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment