Ensures the order in which they were picked (with numbered badge selection)
This commit is contained in:
@@ -117,7 +117,7 @@ struct MediaPicker: UIViewControllerRepresentable {
|
|||||||
var configuration = PHPickerConfiguration(photoLibrary: .shared())
|
var configuration = PHPickerConfiguration(photoLibrary: .shared())
|
||||||
configuration.selectionLimit = 0 // Allows multiple media selection
|
configuration.selectionLimit = 0 // Allows multiple media selection
|
||||||
configuration.filter = imagesOnly ? .images : .any(of: [.images, .videos])
|
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)
|
let picker = PHPickerViewController(configuration: configuration)
|
||||||
picker.delegate = context.coordinator as any PHPickerViewControllerDelegate
|
picker.delegate = context.coordinator as any PHPickerViewControllerDelegate
|
||||||
return picker
|
return picker
|
||||||
|
|||||||
Reference in New Issue
Block a user