CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

TCBaseTableVC 0.1.5

TCBaseTableVC 0.1.5

Maintained by tucao123.



 
Depends on:
MJRefresh>= 0
DZNEmptyDataSet>= 0
 

  • By
  • xtuck

TCBaseTableVC

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

TCBaseTableVC is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TCBaseTableVC'

Author

xtuck:[email protected]

License

TCBaseTableVC is available under the MIT license. See the LICENSE file for more info.

用法:使用“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);
    });
}