Skip to content

Instantly share code, notes, and snippets.

@daoseng33
Created September 18, 2018 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoseng33/2ad7f1dca740ca0c9b28a47019f44e90 to your computer and use it in GitHub Desktop.
Save daoseng33/2ad7f1dca740ca0c9b28a47019f44e90 to your computer and use it in GitHub Desktop.
Get navigation bar edge swipe gesture back
// MARK: - View Lifecycle
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}
// MARK: - UIGestureRecognizerDelegate
extension MyViewController: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldBeRequiredToFailBy otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment