PHPickerViewController preselectedAssetIdentifiers issue

noticed that when I use PHPickerViewController in iOS26, preselectedAssetIdentifiers not working. It doesn't pre-select an image.

This is the code snapshot how I use it with UIViewControllerRepresentable

Same code works in iOS18 but not iOS26

func makeUIViewController(context: Context) -> UIViewController {
        var configuration = PHPickerConfiguration(photoLibrary: PHPhotoLibrary.shared())
        configuration.filter = .images
        configuration.selectionLimit = 5
        configuration.preselectedAssetIdentifiers = ["some id from previous selected results"]
        
        let imagePicker = PHPickerViewController.init(configuration: configuration)
        imagePicker.delegate = context.coordinator

        return imagePicker
    }

Thanks for posting. Here are some troubleshooting steps to try ~

  1. Verify Asset Identifier Validity Even though you're using placeholder text in your post, make sure the actual asset identifiers you're using:

    • Come directly from previous PHPickerResult.assetIdentifier values
    • Refer to assets that are still present in the user's library
    • Haven't expired (asset identifiers can become invalid if the asset is deleted or modified)
  2. Implementation Check When retrieving previous selections:

func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
    let identifiers = results.compactMap { $0.assetIdentifier }  // Store these for future use
}    
  1. iOS Version Specific If this worked previously but not in newer iOS versions, there might be subtle API changes. Could you confirm which specific iOS versions you're testing with?

  2. Confirm Selection Mode Ensure your PHPickerConfiguration is set to allow multiple selections if you're trying to preselect multiple assets.

If you've verified these points and the issue persists, could you share any errors appearing in the console when attempting to use preselection? That might help identify if there's a specific reason the preselection isn't working as expected.

Hi, thanks for reply. Yes, the identifiers are from PHPickerResult, and PHPickerConfiguration has set configuration.selectionLimit = 5.

I am testing with iOS26.2.

There is no error message at all. The image picker opened, but no image is pre-selected even I provided the correct identifiers.

PHPickerViewController preselectedAssetIdentifiers issue
 
 
Q