Skip to content

Instantly share code, notes, and snippets.

@speaktoalvin
Last active October 29, 2015 06:51
Show Gist options
  • Save speaktoalvin/75e4779336ce151f45e6 to your computer and use it in GitHub Desktop.
Save speaktoalvin/75e4779336ce151f45e6 to your computer and use it in GitHub Desktop.
// Handling the pan gesture method
func handleGesture(recognizer:UIScreenEdgePanGestureRecognizer) {
switch recognizer.state {
case .Began: ()
case .Changed:dismissViewControllerAnimated(true, completion: nil)
case .Ended, .Cancelled:
(recognizer.velocityInView(view).x < 0) ? () :
dismissViewControllerAnimated(true, completion: nil)
default: ()
}
}
func safariViewControllerDidFinish(controller: SFSafariViewController)
{
controller.dismissViewControllerAnimated(true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment