Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created June 27, 2020 16:59
Show Gist options
  • Save azamsharp/086f00f3ce5f4cbe0b3d0a5795cab50d to your computer and use it in GitHub Desktop.
Save azamsharp/086f00f3ce5f4cbe0b3d0a5795cab50d to your computer and use it in GitHub Desktop.
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