In using a Picker with SwiftData I am having trouble in obtaining the $selectedPicker value.
For displaying the value with Text(“(selectedCatagory)”) a long alfa-numeric string is given .
This can be seen on the screen shot behind the drop down list
The associated code is
List {
Picker(“Select catagory”,selection: $selectedCatagory) {
ForEach(catagories) { catagory in
Text(catagory.name)
.tag(Optional(catagory))
.font(.caption)
}
}
}
Any advice is appreciated.
Joel