iOS Swift - State Management in SwiftUI
Given this SwiftUI code, what will be displayed after pressing the button twice?
struct ContentView: View {
@State private var clicks = 0
var body: some View {
VStack {
Text("Clicks: \(clicks)")
Button("Tap") {
clicks += 1
}
}
}
}