I'm trying the iOS 16 beta, MacOS 13 beta, and Xcode 14 beta. I can't get TextField to edit a property within a @Binding struct. It works with a @State struct variable, but not binding. Anyone else seeing this problem?
I filed a Feedback with Apple a couple of days ago, but no response yet. I imagine they are swamped the week after WWDC.
- MacOS Version 13.0 Beta (22A5266r)
- Xcode Version 14.0 beta (14A5228q)
Here's a code example of the problem.
import SwiftUI struct ContentView: View { var body: some View { NavigationStack { List { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") } /// Click on Category List NavigationLink { CatList() } label: { Text("Category List") } } } } } struct CatList: View { /// Click on bar @State var catArray: [Categories] = [ Categories(id: UUID(), myName: "foo"), Categories(id: UUID(), myName: "bar")] var body: some View { List { ForEach($catArray) { $eachCat in NavigationLink { CatDetails(thisCategory: $eachCat) } label: { Text(eachCat.myName) } } } } } struct CatDetails: View { @Binding var thisCategory: Categories var body: some View { Form { /// Cannot edit bar. TextField("Name:", text: $thisCategory.myName) } } } struct Categories: Identifiable, Hashable { var id: UUID var myName: String }