TCBaseTableVC 0.1.5

TCBaseTableVC 0.1.5

tucao123 维护。



 
依赖项
MJRefresh>= 0
DZNEmptyDataSet>= 0
 

  • xtuck

TCBaseTableVC

CI Status Version License Platform

示例

要运行示例项目,请克隆仓库,然后从 Example 目录首先运行 pod install

要求

安装

TCBaseTableVC 可通过 CocoaPods 获得。要安装它,只需将该行添加到您的 Podfile 中

pod 'TCBaseTableVC'

作者

xtuck:[email protected]

许可

TCBaseTableVC遵循MIT许可协议。更多信息请参阅LICENSE文件。

用法:使用“UITableView+TCEasy”分类即可,不需要使用TCBaseTableVC基类了

//引入头文件
#import "UITableView+TCEasy.h"


- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView refreshWithDrag];
}

- (UITableView *)tableView {
    if (!_tableView) {
        _tableView = UITableView.easyCreate(self,self.view);
        _tableView.isShowRefreshView = YES;
        _tableView.isShowLoadMoreView = YES;
    }
    return _tableView;
}

- (CellHelper)cellParamsFromFeed:(NSObject *)feed indexPath:(NSIndexPath *)indexPath {
    return CellHelperMake(MBAssetsTableCell.class, nil, YES, 0);
}

- (CGFloat)setCellHeightWithFeed:(NSObject *)feed indexPath:(NSIndexPath *)indexPath {
    return 88;//UITableViewAutomaticDimension
}

- (void)didSelectCellWithFeed:(NSObject *)feed indexPath:(NSIndexPath *)indexPath {
    //点击cell
}

//请求网络数据
- (void)fetchListData:(RequestListDataFinishBlock)finishBlock {
    [TCContractApi fetchContractNoticeListWithPageNum:self.pageNumber pageSize:self.pageSize]
    .l_parseModelClass_parseKey(FMNewsModel.class,@"#.list()") //解析dataKey中的list数组
    .apiCall(^(TCContractApi *api){
        finishBlock(api.resultParseObject,api.error,0);
    });
}