mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix issue where supplementary elements don't track section changes (#404)
* Fix collection view supplementary issue * Add a fast-path * Remove the old index path entry unconditionally * Handle overwriting bug
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class ASSection, ASCollectionElement;
|
||||
@class ASSection, ASCollectionElement, _ASHierarchyChangeSet;
|
||||
|
||||
/**
|
||||
* This mutable version will be removed in the future. It's only here now to keep the diff small
|
||||
@@ -47,12 +47,18 @@ AS_SUBCLASSING_RESTRICTED
|
||||
|
||||
- (void)removeSectionsOfItems:(NSIndexSet *)itemSections;
|
||||
|
||||
- (void)removeSupplementaryElementsInSections:(NSIndexSet *)sections;
|
||||
|
||||
- (void)insertEmptySectionsOfItemsAtIndexes:(NSIndexSet *)sections;
|
||||
|
||||
- (void)insertElement:(ASCollectionElement *)element atIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
/**
|
||||
* Update the index paths for all supplementary elements to account for section-level
|
||||
* deletes, moves, inserts. This must be called before adding new supplementary elements.
|
||||
*
|
||||
* This also deletes any supplementary elements in deleted sections.
|
||||
*/
|
||||
- (void)migrateSupplementaryElementsWithChangeSet:(_ASHierarchyChangeSet *)changeSet;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASElementMap (MutableCopying) <NSMutableCopying>
|
||||
|
||||
Reference in New Issue
Block a user