Ensures the order in which they were picked (with numbered badge selection)

This commit is contained in:
Swift Coder
2024-10-15 22:47:21 -04:00
parent c08e4a2fdd
commit ca5da7b5cd

View File

@@ -117,7 +117,7 @@ struct MediaPicker: UIViewControllerRepresentable {
var configuration = PHPickerConfiguration(photoLibrary: .shared())
configuration.selectionLimit = 0 // Allows multiple media selection
configuration.filter = imagesOnly ? .images : .any(of: [.images, .videos])
configuration.selection = .ordered // images are returned in the order they were selected + numbered badge displayed
let picker = PHPickerViewController(configuration: configuration)
picker.delegate = context.coordinator as any PHPickerViewControllerDelegate
return picker