I have the similar issue.
I did the success from MLModelCollection.beginAccessing, and got the MLModelCollection.
But there is no any entry in the MLModelCollection.
Is there any suggestion how to debug this ??
Post
Replies
Boosts
Views
Activity
Finally, I found how to solve my problems
struct ContentView: View {
@State var isEnableBatch: Bool = false
@State var attValues: [String] = ["", "" , ""] // <- use an array to store every state value
var body: some View {
VStack {
Button {
isEnableBatch.toggle()
// update state value while toggling the button
if isEnableBatch {
for index in 0 ..< 3 {
attValues[index] = "batch Enable"
}
} else {
for index in 0 ..< 3 {
attValues[index] = ""
}
}
} label: {
Image(isEnableBatch == true ? "EAIcon-Check_rectangle" : "EAIcon-Check_Box")
}
List {
ForEach(0 ..< 3, id: \.self) { index in
TextField("", text: $attValues[index]) // <-- find the corresponding state value to binding
}
}
.listStyle(.plain)
}
.padding()
}
}