@State private var selectedItems:[PhotosPickerItem] = [] {
didSet {
print("items changed.")
}
}
...
PhotosPicker(
selection: $selectedItems,
matching: .images,
) {
Text("select pictures")
}
I want to know selectedItem changed, but didSet of selectedItems is not work.
Is there any other way to inform me: Has the user selected some pictures?
I want to create a task to load picture and display them to view after user selected some picture.
Thank you.