Photos regression in iOS 17 likely: -[PHPhotoLibrary presentLimitedLibraryPickerFromViewController:completionHandler:]: unrecognized selector

When selecting more photos with previous limited authorization, I get this crash on iOS 17.0

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PHPhotoLibrary presentLimitedLibraryPickerFromViewController:completionHandler:]: unrecognized selector sent to instance 0x105ea2a60'

when using the synchronous and asynchronous methods:

PHPhotoLibrary.shared().presentLimitedLibraryPicker(from: viewController) { newlySelectedPhotoIDs in ...

OR

let newlySelectedPhotoIDs = await PHPhotoLibrary.shared().presentLimitedLibraryPicker(from: viewController)

Debugger output is unexpected... after all these methods are in the header...

(lldb) po PHPhotoLibrary.shared().responds(to: #selector(PHPhotoLibrary.presentLimitedLibraryPicker(from:)))
false

(lldb) po PHPhotoLibrary.shared().responds(to: #selector(PHPhotoLibrary.presentLimitedLibraryPicker(from:completionHandler:)))
false

Same issue here as well! Surprisingly when setting Prevent limited photos access alert = NO instead of yes it works.

Any clues on how to fix this ?

I faced same issue and it seems a bug in iOS 17 SDK. I recompiled my project with Xcode 14(iOS 16.4 SDK) and it fixes the issue

I was facing the same issue, fixed by adding the PhotosUI.framework to the app target.

Photos regression in iOS 17 likely: -[PHPhotoLibrary presentLimitedLibraryPickerFromViewController:completionHandler:]: unrecognized selector
 
 
Q