mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Add new kittens after last row
New kittens were being added before the last kitten instead of after it because we weren't taking into account the first (header) row.
This commit is contained in:
@@ -149,9 +149,9 @@ static const NSInteger kMaxLitterSize = 100;
|
||||
NSArray *moarKittens = [self createLitterWithSize:kLitterBatchSize];
|
||||
|
||||
NSMutableArray *indexPaths = [[NSMutableArray alloc] init];
|
||||
NSInteger existingKittens = _kittenDataSource.count;
|
||||
NSInteger existingRows = _kittenDataSource.count + 1;
|
||||
for (NSInteger i = 0; i < moarKittens.count; i++) {
|
||||
[indexPaths addObject:[NSIndexPath indexPathForRow:existingKittens + i inSection:0]];
|
||||
[indexPaths addObject:[NSIndexPath indexPathForRow:existingRows + i inSection:0]];
|
||||
}
|
||||
|
||||
_kittenDataSource = [_kittenDataSource arrayByAddingObjectsFromArray:moarKittens];
|
||||
|
||||
Reference in New Issue
Block a user