Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
Created November 28, 2018 20:30
Show Gist options
  • Save cacheleocode/5e2abeed397d51a4abdf7bd38c723dc5 to your computer and use it in GitHub Desktop.
Save cacheleocode/5e2abeed397d51a4abdf7bd38c723dc5 to your computer and use it in GitHub Desktop.
override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
if(presses.first?.type == UIPressType.upArrow) {
debugPrint("up arrow began")
} else if(presses.first?.type == UIPressType.downArrow) {
debugPrint("down arrow began")
}
}
override func pressesEnded(_ presses: Set<UIPress>, with event: UIPressesEvent?) {
if(presses.first!.type == UIPressType.upArrow) {
debugPrint("up arrow ended")
} else if(presses.first!.type == UIPressType.downArrow) {
debugPrint("down arrow ended")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment