When using PhotosPicker in SwiftUI to let users pick a photo, it will fail to load after switching to the "Collections" tab on iOS 18. This issue doesn't occur on iOS 17. Additionally, using PHPickerViewController will still have the same issue.
The code is pretty simple:
struct ContentView: View {
@State private var selection: PhotosPickerItem? = nil
var body: some View {
VStack {
PhotosPicker("Pick photo", selection: $selection)
}
.padding()
}
}
And I create a repo for this code: https://github.com/JuniperPhoton/PhotosPickerIssueiOS18
This issue has been reported via Feedback app, and the report ID is FB15069998.
I tested in the Xcode 16 Beta 6 and iOS 18 Beta 8. However with the Xcode 16 RC and the iOS 18 RC, this issue still exists.
Hoping to find out any workaround to resolve this issue. Thanks.