Block回調

@interface QHBuriedTreasureHistoryTableViewCell : UITableViewCell

- (void)payClick:(void(^)(UIButton *payButton))payBlock;
@property (nonatomic, copy) void(^payBlock)(UIButton *payButton);

@end


@implementation QHBuriedTreasureHistoryTableViewCell

- (void)payClick:(void (^)(UIButton *))payBlock {
    _payBlock = payBlock;
}
#pragma mark 點擊事件中
- (IBAction)didPayClicked:(id)sender {
    if (_payBlock) {
        _payBlock(self.payBtn);
    }
}

@end
相關文章
相關標籤/搜索