To run the example project, clone the repo, and run pod install
from the Example directory first.
TCBaseTableVC is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'TCBaseTableVC'
xtuck:104166631@qq.com
TCBaseTableVC is available under the MIT license. See the LICENSE file for more info.
//引入头文件
#import "UITableView+TCEasy.h"
- (void)viewDidLoad {
[super viewDidLoad];
//如果tableView是xib中的,则使用self.tableView.easyConfig(self,nil);
[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.tableView.pageNumber pageSize:self.tableView.pageSize]
.l_parseModelClass_parseKey(TCNewsModel.class,@"#.list()") //解析dataKey中的list数组
.apiCall(^(TCContractApi *api){
finishBlock(api.resultParseObject,api.error,0);
});
}