Make vibrant button highlight more quickly

This commit is contained in:
Maurice Parker 2019-10-23 12:01:26 -05:00
parent bac205ef84
commit c771bd651c
1 changed files with 15 additions and 0 deletions

View File

@ -30,4 +30,19 @@ class VibrantButton: UIButton {
} }
} }
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
isHighlighted = true
super.touchesBegan(touches, with: event)
}
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
isHighlighted = false
super.touchesEnded(touches, with: event)
}
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
isHighlighted = false
super.touchesCancelled(touches, with: event)
}
} }