From b74dd236134986e1486d819e1e6e41b4e13f8255 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Thu, 21 Nov 2019 11:37:33 +0100 Subject: [PATCH] use isHighlighted instead of intercepting touches --- Source/DropdownTitleView.swift | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Source/DropdownTitleView.swift b/Source/DropdownTitleView.swift index ea9dd66..a87fd3c 100644 --- a/Source/DropdownTitleView.swift +++ b/Source/DropdownTitleView.swift @@ -128,19 +128,10 @@ open class DropdownTitleView: UIControl { } } - override open func touchesBegan(_ touches: Set, with event: UIEvent?) { - super.touchesBegan(touches, with: event) - fadeControls(alpha: 0.5) - } - - override open func touchesEnded(_ touches: Set, with event: UIEvent?) { - super.touchesEnded(touches, with: event) - fadeControls(alpha: 1) - } - - override open func touchesCancelled(_ touches: Set, with event: UIEvent?) { - super.touchesCancelled(touches, with: event) - fadeControls(alpha: 1) + open override var isHighlighted: Bool { + didSet { + fadeControls(alpha: isHighlighted ? 0.5 : 1) + } } open override func sizeThatFits(_ size: CGSize) -> CGSize {