Trigger updating interfaceState for cells in case ASTableView or ASCollectionView becomes visible or invisible

This commit is contained in:
Michael Schneider 2016-02-29 17:04:25 -08:00
parent 07ad27c7f6
commit 084e6f82c1
2 changed files with 7 additions and 1 deletions

View File

@ -532,7 +532,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(_ASCollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
[_rangeController visibleNodeIndexPathsDidChangeWithScrollDirection:[self scrollDirection]];
[_rangeController visibleNodeIndexPathsDidChangeWithScrollDirection:self.scrollDirection];
if ([_asyncDelegate respondsToSelector:@selector(collectionView:willDisplayNodeForItemAtIndexPath:)]) {
[_asyncDelegate collectionView:self willDisplayNodeForItemAtIndexPath:indexPath];
@ -1081,6 +1081,9 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
if (!visible && node.inHierarchy) {
[node __exitHierarchy];
}
// Trigger updating interfaceState for cells in case ASCollectionView becomes visible or invisible
[_rangeController visibleNodeIndexPathsDidChangeWithScrollDirection:self.scrollDirection];
}
#pragma mark - UICollectionView dead-end intercepts

View File

@ -1056,6 +1056,9 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
if (!visible && node.inHierarchy) {
[node __exitHierarchy];
}
// Trigger updating interfaceState for cells in case ASTableView becomes visible or invisible
[_rangeController visibleNodeIndexPathsDidChangeWithScrollDirection:self.scrollDirection];
}
@end