File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
ZHTableViewGroupExample/ZHTableViewGroupObjc Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -76,15 +76,18 @@ + (UITableViewCell *)cellForRowAtWithDataSource:(ZHTableViewDataSource *)dataSou
7676 config : (BOOL )config
7777 useCache : (BOOL )useCache {
7878 ZHTableViewGroup *group = [self groupForSectionWithDataSource: dataSource section: indexPath.section];
79+ ZHTableViewCell *tableViewCell = [group tableViewCellForIndexPath: indexPath];
7980 UITableViewCell *cell = [[UITableViewCell alloc ] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: nil ];
8081 if (!group) {
8182 return cell;
8283 }
8384 UITableViewCell *resultCell;
8485 if (useCache) {
85- resultCell = [dataSource cacheCellWithIndexPath: indexPath];
86- ZHTableViewCell *tableViewCell = [group tableViewCellForIndexPath: indexPath];
87- [group tableViewCell: tableViewCell configCell: resultCell atIndexPath: indexPath];
86+ UITableViewCell *cacheCell = [dataSource cacheCellWithIndexPath: indexPath];
87+ if ([cacheCell isKindOfClass: tableViewCell.anyClass]) {
88+ resultCell = [dataSource cacheCellWithIndexPath: indexPath];
89+ [group tableViewCell: tableViewCell configCell: resultCell atIndexPath: indexPath];
90+ }
8891 }
8992 if (!resultCell) {
9093 resultCell = [group cellForTableViewWithTableView: dataSource.tableView
@@ -94,7 +97,6 @@ + (UITableViewCell *)cellForRowAtWithDataSource:(ZHTableViewDataSource *)dataSou
9497 if (!resultCell) {
9598 return cell;
9699 }
97- ZHTableViewCell *tableViewCell = [group tableViewCellForIndexPath: indexPath];
98100 NSIndexPath *realIndexPath = [group indexPathWithCell: tableViewCell indexPath: indexPath];
99101 BOOL isHidden = [tableViewCell isHiddenWithIndexPath: realIndexPath];
100102 resultCell.hidden = isHidden;
Original file line number Diff line number Diff line change 88
99Pod ::Spec . new do |s |
1010 s . name = 'ZHTableViewGroupObjc'
11- s . version = '3.5.3 '
11+ s . version = '3.5.5 '
1212 s . summary = 'Manger UITableView DataSource More Cell Style'
1313
1414 s . homepage = 'https://github.com/josercc/ZHTableViewGroup'
You can’t perform that action at this time.
0 commit comments