import "TableView.h"
@interface TableView()
@property (nonatomic, copy) void (^reloadDataComBlock)();
@end
@implementation TableView
- (void)reloadDataWithCompletion:(void (^)())reloadDataComBlock {
self.reloadDataComBlock = reloadDataComBlock;
[super reloadData];
} - (void)layoutSubviews {
[super layoutSubviews];
if (self.reloadDataCompletionBlock) {
self.reloadDataCompletionBlock();
self.reloadDataCompletionBlock = nil;
}
}
@end
// 调用的时候
[self.tableView reloadDataComBlock:^{
NSLog(@"完成刷新");
}];
网友评论