_ASHierarchyChangeSet: add section change mapping methods, fix section exclusions

This commit is contained in:
Adlai Holler
2015-11-26 10:42:35 -08:00
parent 4bfdd82568
commit 41ecaa7bb2
2 changed files with 50 additions and 8 deletions

View File

@@ -34,6 +34,21 @@ typedef NS_ENUM(NSInteger, _ASHierarchyChangeType) {
@interface _ASHierarchyChangeSet : NSObject
/// @precondition The change set must be completed.
@property (nonatomic, strong, readonly) NSIndexSet *deletedSections;
/// @precondition The change set must be completed.
@property (nonatomic, strong, readonly) NSIndexSet *insertedSections;
/// @precondition The change set must be completed.
@property (nonatomic, strong, readonly) NSIndexSet *reloadedSections;
/**
Get the section index after the update for the given section before the update.
@precondition The change set must be completed.
@returns The new section index, or NSNotFound if the given section was deleted.
*/
- (NSInteger)newSectionForOldSection:(NSInteger)oldSection;
@property (nonatomic, readonly) BOOL completed;
/// Call this once the change set has been constructed to prevent future modifications to the changeset. Calling this more than once is a programmer error.