Hello everyone trying to return a boolean to the method i called from within a block after the user selects the option to allow or not access to photolibrary. How can i return a boolean from this specific block?
(BOOL)checkIfUserHasAccessToPhotosLibrary{
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
if (status == PHAuthorizationStatusNotDetermined) {
NSLog(@"Access has not been determined check again");
__block BOOL boolean=false;
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {
NSLog(@"User responded has access to photos library");
boolean=true;
}
else {
NSLog(@"User responded does has access to photos library");
boolean=false;
}
}];
}
}