SwiftUI @Binding update doesn't refresh view
问题 I feel like I'm missing something very basic, but this example SwiftUI code will not modify the view (despite the Binding updating) when the button is clicked Tutorials I have read suggest this is the correct way to use a binding and the view should refresh automatically import SwiftUI struct ContentView: View { @Binding var isSelected: Bool var body: some View { Button(action: { self.isSelected.toggle() }) { Text(isSelected ? "Selected" : "Not Selected") } } } struct ContentView_Previews: