mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge commit '19a9d29aa873edcf5624bed7fa9ee86662da0bfd'
# Conflicts: # Source/Details/ASCollectionGalleryLayoutDelegate.m
This commit is contained in:
@@ -346,6 +346,13 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
_retainedLayer = self.layer;
|
||||
}
|
||||
|
||||
// iOS 11 automatically uses estimated heights, so disable those (see PR #485)
|
||||
if (AS_AT_LEAST_IOS11) {
|
||||
super.estimatedRowHeight = 0.0;
|
||||
super.estimatedSectionHeaderHeight = 0.0;
|
||||
super.estimatedSectionFooterHeight = 0.0;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -542,7 +549,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
[self reloadData];
|
||||
[_dataController waitUntilAllUpdatesAreCommitted];
|
||||
[_dataController waitUntilAllUpdatesAreProcessed];
|
||||
}
|
||||
|
||||
- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated
|
||||
@@ -729,6 +736,16 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isProcessingUpdates
|
||||
{
|
||||
return [_dataController isProcessingUpdates];
|
||||
}
|
||||
|
||||
- (void)onDidFinishProcessingUpdates:(nullable void (^)())completion
|
||||
{
|
||||
[_dataController onDidFinishProcessingUpdates:completion];
|
||||
}
|
||||
|
||||
- (void)waitUntilAllUpdatesAreCommitted
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
@@ -737,15 +754,16 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
// ASDisplayNodeFailAssert(@"Should not call %@ during batch update", NSStringFromSelector(_cmd));
|
||||
return;
|
||||
}
|
||||
|
||||
[_dataController waitUntilAllUpdatesAreCommitted];
|
||||
|
||||
[_dataController waitUntilAllUpdatesAreProcessed];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
// Remeasure all rows if our row width has changed.
|
||||
_remeasuringCellNodes = YES;
|
||||
CGFloat constrainedWidth = self.bounds.size.width - [self sectionIndexWidth];
|
||||
UIEdgeInsets contentInset = self.contentInset;
|
||||
CGFloat constrainedWidth = self.bounds.size.width - [self sectionIndexWidth] - contentInset.left - contentInset.right;
|
||||
if (constrainedWidth > 0 && _nodesConstrainedWidth != constrainedWidth) {
|
||||
_nodesConstrainedWidth = constrainedWidth;
|
||||
|
||||
@@ -1622,7 +1640,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
|
||||
#pragma mark - ASDataControllerSource
|
||||
|
||||
- (id)dataController:(ASDataController *)dataController viewModelForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
- (id)dataController:(ASDataController *)dataController nodeModelForItemAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Not currently supported for tables. Will be added when the collection API stabilizes.
|
||||
return nil;
|
||||
|
||||
Reference in New Issue
Block a user