From c771bd651c3db2b805eb0a9e374a67c8d300de80 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 23 Oct 2019 12:01:26 -0500 Subject: [PATCH] Make vibrant button highlight more quickly --- iOS/UIKit Extensions/VibrantButton.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/iOS/UIKit Extensions/VibrantButton.swift b/iOS/UIKit Extensions/VibrantButton.swift index 8e070e4d1..dc311d549 100644 --- a/iOS/UIKit Extensions/VibrantButton.swift +++ b/iOS/UIKit Extensions/VibrantButton.swift @@ -30,4 +30,19 @@ class VibrantButton: UIButton { } } + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + isHighlighted = true + super.touchesBegan(touches, with: event) + } + + override func touchesEnded(_ touches: Set, with event: UIEvent?) { + isHighlighted = false + super.touchesEnded(touches, with: event) + } + + override func touchesCancelled(_ touches: Set, with event: UIEvent?) { + isHighlighted = false + super.touchesCancelled(touches, with: event) + } + }