空白提示第三方开源库—— DZNEmptyDataSet

1.pod 导入
2.导入头文件 #import "UIScrollView+EmptyDataSet.h"
3.继承代理 DZNEmptyDataSetDelegate,DZNEmptyDataSetSource
4.BaseTableView.m

- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style{
    self = [super initWithFrame:frame style:style];
    if (self) {
        self.emptyDataSetDelegate = self;
        self.emptyDataSetSource = self;
        
        self.tableFooterView = [UIView new];
    }
    return self;
}

- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView{
    return kColorWhite;
}

- (UIImage *)buttonImageForEmptyDataSet:(UIScrollView *)scrollView forState:(UIControlState)state{
    return [UIImage imageNamed:@"login_icon_weibo"];
}

- (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button{
    //刷新页面 
    if (self.reloadBlock) {
        self.reloadBlock();
    }
}

你可能感兴趣的:(空白提示第三方开源库—— DZNEmptyDataSet)