mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
fix inserting sections bug
This commit is contained in:
@@ -53,9 +53,17 @@ static const CGFloat kASFlowLayoutControllerRefreshingThreshold = 0.3;
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)insertSectionsAtIndexSet:(NSIndexSet *)indexSet {
|
||||
- (void)insertSections:(NSArray *)sections atIndexSet:(NSIndexSet *)indexSet {
|
||||
__block int cnt = 0;
|
||||
[indexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
|
||||
_nodeSizes.insert(_nodeSizes.begin() + idx, std::vector<CGSize>());
|
||||
NSArray *nodes = sections[cnt++];
|
||||
std::vector<CGSize> v(nodes.count);
|
||||
|
||||
for (int i = 0; i < nodes.count; i++) {
|
||||
v.push_back([nodes[i] CGSizeValue]);
|
||||
}
|
||||
|
||||
_nodeSizes.insert(_nodeSizes.begin() + idx, v);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user