Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created June 27, 2020 17:27
Show Gist options
  • Save azamsharp/7b7f56f4900150e1f96a05fc2b8d6d52 to your computer and use it in GitHub Desktop.
Save azamsharp/7b7f56f4900150e1f96a05fc2b8d6d52 to your computer and use it in GitHub Desktop.
struct CounterView: View {
@StateObject var counter = Counter()
var body: some View {
VStack {
Text("\(counter.value)")
Button("Increment Counter") {
counter.value += 1
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment