Skip to content

Commit

Permalink
fix: 支持 UITableViewHeaderFooterView 圈选
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Aug 3, 2023
1 parent 50db430 commit 8ed5c8f
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,25 @@
@implementation UITableView (GrowingNode)

- (NSArray<id<GrowingNode>> *)growingNodeChilds {
// 对于collectionView我们仅需要返回可见cell
NSMutableArray *childs = [NSMutableArray array];
[childs addObjectsFromArray:self.visibleCells];

NSArray<NSIndexPath *> *indexPaths = self.indexPathsForVisibleRows;
NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
for (NSIndexPath *indexPath in indexPaths) {
[indexSet addIndex:indexPath.section];
}
[indexSet enumerateIndexesUsingBlock:^(NSUInteger section, BOOL * _Nonnull stop) {
UITableViewHeaderFooterView *headerView = [self headerViewForSection:section];
if (headerView) {
[childs addObject:headerView];
}
UITableViewHeaderFooterView *footerView = [self footerViewForSection:section];
if (footerView) {
[childs addObject:footerView];

Check warning on line 42 in GrowingAutotrackerCore/GrowingNode/Category/UITableView+GrowingNode.m

View check run for this annotation

Codecov / codecov/patch

GrowingAutotrackerCore/GrowingNode/Category/UITableView+GrowingNode.m#L42

Added line #L42 was not covered by tests
}
}];

if (self.tableFooterView) {
[childs addObject:self.tableFooterView];
}
Expand Down

0 comments on commit 8ed5c8f

Please sign in to comment.