Created
December 21, 2017 00:27
-
-
Save jazzedge/b8ff66306750e940d5d6eb3bc69605a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See:https://www.hackingwithswift.com/example-code/uikit/how-to-detect-edge-swipes | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let edgePan = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(screenEdgeSwiped)) | |
edgePan.edges = .left | |
view.addGestureRecognizer(edgePan) | |
} | |
@objc func screenEdgeSwiped(_ recognizer: UIScreenEdgePanGestureRecognizer) { | |
if recognizer.state == .recognized { | |
print("Screen edge swiped!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment