Created
July 4, 2020 23:28
-
-
Save aheze/7311fc90d89903dbe93f17b6bb9cfe31 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
/// we can make the modifier more Swifter by wrapping it in a method... | |
/// ... then making the method an extension of View, so we can easily add it to any SwiftUI view | |
public extension View { | |
func onTouchDownUpEvent(changeState: @escaping (ButtonState) -> Void) -> some View { | |
modifier(TouchDownUpEventModifier(changeState: changeState)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment