PhotosPicker(selection: $vm.selectedItemsTest,
maxSelectionCount: 10,
selectionBehavior: .continuous,
matching: .images) {
Image(systemName: "trophy")
//.font(.system(size: scaled16*1.5))
.font(Font.system(size: scaled16*1.5, weight: .regular))
.foregroundColor(Color.black)
}.onChange(of: vm.selectedItemsTest) { newValue in
print("print selected")
}
This is the sample code. It used to work until I updated Xcode from 14.3 to 15.
If maxSelectionCount is 1, everything works well. But if it is more than one, PhotosPicker opens up the photo library. However, when I select a photo, it automatically and quickly deselects it again.
Trying to select multiple photos, but I can't.