如何在按钮发送器中调用dispatch_block_t?当前,dispatch_block_t在HeadView下,停在viewForSupplementaryElementOfKind下。示例代码如下:-
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
UICollectionReusableView *reusableview = nil;
if (kind == UICollectionElementKindSectionHeader){
ProductMerchant_HeadView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:ProductMerchant_HeadViewID forIndexPath:indexPath];
WEAKSELF
headerView.filterClickBlock = ^{ //Click on filter header
//something here.....
};
reusableview = headerView;
}
if (kind == UICollectionElementKindSectionFooter) {
}
return reusableview;
}
- (void)clickFilterButton:(id)sender {
//HOW CAN I CALL headerView.filterClickBlock = ^{} HERE?
}