- Notifications
You must be signed in to change notification settings - Fork12
Manger UITableView DataSource Cells
License
NotificationsYou must be signed in to change notification settings
josercc/ZHTableViewGroup
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Swift 版本请移步这里
ZHTableViewGroup为UITableView和UICollectionView 而生
ZHTableViewDataSource *dataSource = [[ZHTableViewDataSourcealloc]initWithTableView:self.tableView];[dataSourceclearData];[dataSourceaddGroupWithCompletionHandle:^(ZHTableViewGroup * _Nonnull group) { [groupaddCellWithCompletionHandle:^(ZHTableViewCell *tableViewCell) { tableViewCell.anyClass = [UITableViewCellclass]; tableViewCell.identifier =@"UITableViewCell";NSArray<NSString *> *titles = @[@"刷新高度",@"刷新Cell",@"刷新数据",@"显示和隐藏"]; tableViewCell.cellNumber = titles.count; [tableViewCellsetConfigCompletionHandle:^(UITableViewCell *cell,NSIndexPath *indexPath) { cell.textLabel.text = titles[indexPath.row]; }]; }];}];[dataSourcereloadTableViewData];
[self.tableViewDataSourceclearData];[self.tableViewDataSourceaddGroupWithCompletionHandle:^(ZHTableViewGroup *group) { [groupaddCellWithCompletionHandle:^(ZHTableViewCell<ReloadHeightCell1 *> *cell) { self->_weakCell = cell; cell.anyClass = [ReloadHeightCell1class]; cell.identifier =@"ReloadHeightCell1"; [cellsetConfigCompletionHandle:^(ReloadHeightCell1 *cell1,NSIndexPath *indexPath) { cell1.textLabel.text =@"ReloadHeightCell1"; }]; }];}];[self.tableViewDataSourceaddGroupWithCompletionHandle:^(ZHTableViewGroup *group) { [groupaddCellWithCompletionHandle:^(ZHTableViewCell<ReloadHeightCell2 *> *cell) { cell.anyClass = [ReloadHeightCell2class]; cell.identifier =@"ReloadHeightCell2"; cell.cellNumber =2; [cellsetConfigCompletionHandle:^(ReloadHeightCell2 *cell1,NSIndexPath *indexPath) { cell1.textLabel.text =@"ReloadHeightCell2"; }]; }];}];[self.tableViewDataSourcereloadTableViewData];
[self.tableViewDataSourcereloadCellAutomaticHeightWithIdentifier:@"ReloadHeightCell1"]
[self.tableViewDataSourcereloadCellFixedHeight:250identifier:@"ReloadHeightCell1"]
[self.tableViewDataSourcereloadCellAutomaticHeightWithClass:NSClassFromString(@"ReloadHeightCell1")]
[self.tableViewDataSourcereloadCellFixedHeight:260className:NSClassFromString(@"ReloadHeightCell1")]
[self.tableViewDataSourcereloadCellAutomaticHeightWithTableViewCell:self.tableViewDataSource.groups[0].cells[0]]
[self.tableViewDataSourcereloadCellFixedHeight:270tableViewCell:self.tableViewDataSource.groups[0].cells[0]]
[self.tableViewDataSourcereloadCellAutomicHeightWithGroupIndex:1cellIndex:0]
[self.tableViewDataSourcereloadCellFixedHeight:280groupIndex:1cellIndex:0]
[self.tableViewDataSourceclearData];[self.tableViewDataSourceaddGroupWithCompletionHandle:^(ZHTableViewGroup *group) { [groupaddCellWithCompletionHandle:^(ZHTableViewCell *cell) { cell.anyClass = [UITableViewCellclass]; cell.identifier =@"UITableViewCell"; [cellsetConfigCompletionHandle:^(UITableViewCell *cell,NSIndexPath *indexPath) { cell.textLabel.text = [@(random() %99 +1)stringValue]; }]; }];}];[self.tableViewDataSourcereloadTableViewData];
[self.tableViewDataSourcereloadCellWithIdentifier:@"UITableViewCell"]
[self.tableViewDataSourcereloadCellWithClassName:[UITableViewCellclass]]
[self.tableViewDataSourcereloadCellWithTableViewCell:self.tableViewDataSource.groups[0].cells[0]]
[self.tableViewDataSourcereloadCellWithGroupIndex:0cellIndex:0]
_randoms = [NSMutableArrayarrayWithArray:@[@"random"]];[self.tableViewDataSourceclearData];[self.tableViewDataSourceaddGroupWithCompletionHandle:^(ZHTableViewGroup *group) { [groupaddCellWithCompletionHandle:^(ZHTableViewCell *cell) { cell.anyClass = [UITableViewCellclass]; cell.identifier =@"UITableViewCell"; cell.cellNumber = _randoms.count; [cellsetConfigCompletionHandle:^(UITableViewCell *cell,NSIndexPath *indexPath) { cell.textLabel.text = _randoms[indexPath.row]; }]; }];}];[self.tableViewDataSourcereloadTableViewData];
[self.tableViewDataSourcereloadCellWithDataCount:_randoms.countidentifier:@"UITableViewCell"]
[self.tableViewDataSourcereloadCellWithDataCount:_randoms.countclassName:[UITableViewCellclass]]
[self.tableViewDataSource reloadCellWithDataCount:_randoms.count tableViewCell:self.tableViewDataSource.groups[0].cells[0]]
[self.tableViewDataSourcereloadCellWithDataCount:_randoms.countgroupIndex:0cellIndex:0]
[self.tableViewDataSourceclearData];[self.tableViewDataSourceaddGroupWithCompletionHandle:^(ZHTableViewGroup *group) { [groupaddCellWithCompletionHandle:^(ZHTableViewCell *cell) { cell.anyClass = [UITableViewCellclass]; cell.identifier =@"UITableViewCell"; cell.cellNumber =10; [cellsetConfigCompletionHandle:^(UITableViewCell *cell,NSIndexPath *indexPath) { cell.textLabel.text = [@(indexPath.row +1)stringValue]; }]; [cellsetHiddenBlock:^BOOL(NSIndexPath *indexPath) {return _hidden && indexPath.row >=5 && indexPath.row <=8; }]; }];}];[self.tableViewDataSourcereloadTableViewData];
[self.tableViewDataSourcereloadAllHiddenCell]
pod'ZHTableViewGroup'
github"josercc/ZHTableViewGroup"
.package(url:"https://github.com/josercc/ZHTableViewGroup.git", from:"3.0.0")
About
Manger UITableView DataSource Cells
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published




