Reputation: 3324
Trying to use the following code when PhPhoto status is PHAuthorizationStatusLimited
PHAuthorizationStatus prevStatus = [PHPhotoLibrary authorizationStatus];
if (prevStatus == PHAuthorizationStatusLimited)
{
[PHPhotoLibrary requestAuthorizationForAccessLevel:(PHAccessLevelReadWrite) handler:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusLimited) {
dispatch_async(dispatch_get_main_queue(), ^{
[PHPhotoLibrary presentLimitedLibraryPickerFromViewController:self];
});
}
}];
I get No known class method for selector 'presentLimitedLibraryPickerFromViewController: [PHPhotoLibrary presentLimitedLibraryPickerFromViewController:self];
I need to show the user the limited library to select photos. Are there any other options at this specific state? What am i missing?
Upvotes: 0
Views: 443
Reputation: 295
You need to init viewController that handles the display before =>
UIViewController *presentedViewController = RCTPresentedViewController();
[[PHPhotoLibrary sharedPhotoLibrary] presentLimitedLibraryPickerFromViewController:presentedViewController];
Upvotes: 0