'How to return boolean from a block in objective c?

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;
                 
             }

         }];
    }

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source