I want to save images into a UIImage array in the same order in which it is selected using PHPickerViewController. Is this possible?
Assets returned to you are always sorted by the user selection order (even if configuration.selection == .default
). Please keep in mind that fetching asset data using the item provider is async so you need to ensure that the selection order is preserved manually.
You can also set configuration.selection = .ordered
if selection order is very important to your app. The Photos picker will adjust its UI and behavior based on configuration.selection
.