Created
February 1, 2026 22:06
-
-
Save jacobsapps/129a98e60f02f4a90146178c52f732ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class PressableView: UIView { | |
| /* Lots of UI setup boilerplate ... */ | |
| override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
| super.touchesBegan(touches, with: event) | |
| setPressed(true) | |
| } | |
| override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { | |
| super.touchesEnded(touches, with: event) | |
| setPressed(false) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment