Post

Replies

Boosts

Views

Activity

Is SwiftUI Picker not compatible with a Bindable property?
I have a view with @Bindable property. (It's a model) I can use TextField("Name", text: $chore.name), but not Picker(selection: $chore.choreFrequency, label: EmptyView()) The auto-complete doesn't even show choreFrequency as an option enum ChoreFrequency: String, CaseIterable, Identifiable, Codable { case daily, weekly, monthly, seasonal var id: ChoreFrequency { self } } @Model class Chore: Identifiable { @Attribute(.unique) var id = UUID() var name: String var frequency: ChoreFrequency var assignedTo: FamilyMember var isComplete: Bool var dueDate: Date } Can I not use the Bindable property in the Picker?
3
0
1.2k
Sep ’23