iOS 14, App crash when call presentLimitedLibraryPickerFromViewControlle

iPhone7 : iOS 14.0 Beta 5
Xcode-beta
Mac OS : 10.15.5 (19F101)

crash info :

Code Block
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PHPhotoLibrary presentLimitedLibraryPickerFromViewController:]: unrecognized selector sent to instance xxxxxx'
terminating with uncaught exception of type NSException

my code:
Code Block
- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];
  if (@available(iOS 14, *)) {
    [[PHPhotoLibrary sharedPhotoLibrary] presentLimitedLibraryPickerFromViewController:self];
  }
}


Answered by Engineer in 631757022
Does your app link with PhotosUI framework?
i have the same crash
Accepted Answer
Does your app link with PhotosUI framework?
It only happens on Objective-C and I reported to Apple about a month ago, but hasn't been fixed yet. You will need to create a Swift class for it in the meantime.
Is this fixed?
@JoeyMEA you are right. This crashes is only observed in Objective C and not Swift.
link PhotosUI.framework
in
TARGETS > General > Frameworks and Libraries

you will fix this bug
iOS 14, App crash when call presentLimitedLibraryPickerFromViewControlle
 
 
Q