After BLOCK Completed only Return

后端 未结 3 1292
别跟我提以往
别跟我提以往 2020-12-22 15:28

May I know is what are the solution to use in order to make the following code working in order.

- (CGFloat)getRowImageHeight
{
    CGFloat defaultHeight   =         


        
3条回答
  •  伪装坚强ぢ
    2020-12-22 15:58

    the good approach would be something like this:

    - (void)getRowImageHeightWithCompletionBlock:(void(^)(CGFloat height))completion {
        CGFloat defaultHeight = 300.f;
        [self configureImageTVCell:self.itemImageTVCell block:^(UIImage *image, BOOL succeeded) {
            if(succeeded && completion) {
                completion(image.size.height);
            }
        }];
    }
    

提交回复
热议问题