mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-21 05:39:01 +00:00
Address pull request comments
This commit is contained in:
parent
d3ba80ccfd
commit
19232ac493
@ -919,16 +919,17 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
|||||||
{
|
{
|
||||||
ASCollectionNode *collectionNode = self.collectionNode;
|
ASCollectionNode *collectionNode = self.collectionNode;
|
||||||
if (collectionNode && [collectionNode supportsRangeManagedInterfaceState]) {
|
if (collectionNode && [collectionNode supportsRangeManagedInterfaceState]) {
|
||||||
// Only use the interfaceStatate of nodes that are range managed
|
// Only use the interfaceState of nodes that are range managed
|
||||||
return collectionNode.interfaceState;
|
return collectionNode.interfaceState;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// For not range managed nodes or until we can always create an associated ASCollectionNode
|
// For not range managed nodes or 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
|
// 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.
|
// handles this even if it is the root / directly added to the view hierarchy.
|
||||||
return (self.window != nil ? ASInterfaceStateVisible : ASInterfaceStateNone);
|
return (self.window != nil ? ASInterfaceStateVisible : ASInterfaceStateNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray *)rangeController:(ASRangeController *)rangeController nodesAtIndexPaths:(NSArray *)indexPaths
|
- (NSArray *)rangeController:(ASRangeController *)rangeController nodesAtIndexPaths:(NSArray *)indexPaths
|
||||||
{
|
{
|
||||||
return [_dataController nodesAtIndexPaths:indexPaths];
|
return [_dataController nodesAtIndexPaths:indexPaths];
|
||||||
|
|||||||
@ -1980,6 +1980,10 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
|||||||
// subclass override
|
// subclass override
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We currently only set interface state on nodes in table/collection views. For other nodes, if they are
|
||||||
|
* in the hierarchy we enable all ASInterfaceState types with `ASInterfaceStateInHierarchy`, otherwise `None`.
|
||||||
|
*/
|
||||||
- (BOOL)supportsRangeManagedInterfaceState
|
- (BOOL)supportsRangeManagedInterfaceState
|
||||||
{
|
{
|
||||||
return ASHierarchyStateIncludesRangeManaged(_hierarchyState);
|
return ASHierarchyStateIncludesRangeManaged(_hierarchyState);
|
||||||
|
|||||||
@ -796,15 +796,15 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
{
|
{
|
||||||
ASTableNode *tableNode = self.tableNode;
|
ASTableNode *tableNode = self.tableNode;
|
||||||
if (tableNode && [tableNode supportsRangeManagedInterfaceState]) {
|
if (tableNode && [tableNode supportsRangeManagedInterfaceState]) {
|
||||||
// Only use the interfaceStatate of nodes that are range managed
|
// Only use the interfaceState of nodes that are range managed
|
||||||
return self.tableNode.interfaceState;
|
return self.tableNode.interfaceState;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// For not range managed nodes or until we can always create an associated ASTableNode
|
// For not range managed nodes or until we can always create an associated ASTableNode
|
||||||
// without a retain cycle, we might be on our own to try to guess if we're visible. The node normally
|
// 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.
|
// handles this even if it is the root / directly added to the view hierarchy.
|
||||||
return (self.window != nil ? ASInterfaceStateVisible : ASInterfaceStateNone);
|
return (self.window != nil ? ASInterfaceStateVisible : ASInterfaceStateNone);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - ASRangeControllerDelegate
|
#pragma mark - ASRangeControllerDelegate
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user