mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Ignore Relayout Requests for Deleted Cell Nodes (#279)
* Data Controller: Ignore relayout requests for elements that have been deleted in the mean-time. * Bolster our logchange * Add sanity check
This commit is contained in:
@@ -1664,9 +1664,12 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
|
||||
- (BOOL)dataController:(ASDataController *)dataController presentedSizeForElement:(ASCollectionElement *)element matchesSize:(CGSize)size
|
||||
{
|
||||
NSIndexPath *indexPath = [self indexPathForNode:element.node];
|
||||
if (indexPath == nil) {
|
||||
ASDisplayNodeFailAssert(@"Data controller should not ask for presented size for element that is not presented.");
|
||||
return YES;
|
||||
}
|
||||
UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
|
||||
CGRect rect = attributes.frame;
|
||||
return CGSizeEqualToSizeWithIn(rect.size, size, FLT_EPSILON);
|
||||
return CGSizeEqualToSizeWithIn(attributes.size, size, FLT_EPSILON);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user