Restore full functionality of the display / data ranges when not using the Node variants of Table / Collection.

This commit is contained in:
Scott Goodson
2016-01-19 18:30:01 -08:00
parent 46bcc90185
commit b989be6499
2 changed files with 18 additions and 2 deletions

View File

@@ -801,7 +801,15 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
- (ASInterfaceState)interfaceStateForRangeController:(ASRangeController *)rangeController
{
return self.collectionNode.interfaceState;
ASCollectionNode *collectionNode = self.collectionNode;
if (collectionNode) {
return self.collectionNode.interfaceState;
} else {
// Until we can always create an associated ASCollectionNode without a retain cycle,
// we might be on our own to try to guess if we're visible. The node normally
// handles this even if it is the root / directly added to the view hierarchy.
return (self.window != nil ? ASInterfaceStateVisible : ASInterfaceStateNone);
}
}
- (NSArray *)rangeController:(ASRangeController *)rangeController nodesAtIndexPaths:(NSArray *)indexPaths