Created
June 27, 2020 16:59
-
-
Save azamsharp/086f00f3ce5f4cbe0b3d0a5795cab50d 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
struct CounterView: View { | |
@ObservedObject var counter = Counter() | |
var body: some View { | |
VStack { | |
Text("\(counter.value)") | |
Button("Increment Counter") { | |
counter.value = counter.value + 1 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment