diff --git a/Tusker/Screens/Utilities/CustomAlertController.swift b/Tusker/Screens/Utilities/CustomAlertController.swift index d13288ff..67469a32 100644 --- a/Tusker/Screens/Utilities/CustomAlertController.swift +++ b/Tusker/Screens/Utilities/CustomAlertController.swift @@ -394,6 +394,8 @@ class CustomAlertActionButton: UIControl { self.isContextMenuInteractionEnabled = true self.showsMenuAsPrimaryAction = action.handler == nil } + + addGestureRecognizer(UIHoverGestureRecognizer(target: self, action: #selector(hoverRecognized))) } required init?(coder: NSCoder) { @@ -429,6 +431,17 @@ class CustomAlertActionButton: UIControl { super.contextMenuInteraction(interaction, willEndFor: configuration, animator: animator) } + @objc func hoverRecognized(_ recognizer: UIHoverGestureRecognizer) { + switch recognizer.state { + case .began, .changed: + backgroundColor = .secondarySystemFill + case .ended: + backgroundColor = nil + default: + break + } + } + override func touchesBegan(_ touches: Set, with event: UIEvent?) { super.touchesBegan(touches, with: event)