rename _batchUpdateFlag to _performingBatchUpdates

This commit is contained in:
Li Tan 2015-02-11 15:22:24 -08:00
parent 25bdd0d84d
commit dcb30b359c

View File

@ -99,7 +99,7 @@ static BOOL _isInterceptedSelector(SEL sel)
ASRangeController *_rangeController; ASRangeController *_rangeController;
ASFlowLayoutController *_layoutController; ASFlowLayoutController *_layoutController;
BOOL _batchUpdateFlag; BOOL _performingBatchUpdates;
NSMutableArray *_batchUpdateBlocks; NSMutableArray *_batchUpdateBlocks;
} }
@ -131,7 +131,7 @@ static BOOL _isInterceptedSelector(SEL sel)
_proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:nil interceptor:self]; _proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:nil interceptor:self];
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate; super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
_batchUpdateFlag = NO; _performingBatchUpdates = NO;
_batchUpdateBlocks = [NSMutableArray array]; _batchUpdateBlocks = [NSMutableArray array];
[self registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"]; [self registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"];
@ -380,7 +380,7 @@ static BOOL _isInterceptedSelector(SEL sel)
- (void)rangeControllerBeginUpdates:(ASRangeController *)rangeController { - (void)rangeControllerBeginUpdates:(ASRangeController *)rangeController {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();
_batchUpdateFlag = YES; _performingBatchUpdates = YES;
} }
- (void)rangeControllerEndUpdates:(ASRangeController *)rangeController completion:(void (^)(BOOL))completion { - (void)rangeControllerEndUpdates:(ASRangeController *)rangeController completion:(void (^)(BOOL))completion {
@ -397,7 +397,7 @@ static BOOL _isInterceptedSelector(SEL sel)
}]; }];
[_batchUpdateBlocks removeAllObjects]; [_batchUpdateBlocks removeAllObjects];
_batchUpdateFlag = NO; _performingBatchUpdates = NO;
} }
- (NSArray *)rangeControllerVisibleNodeIndexPaths:(ASRangeController *)rangeController - (NSArray *)rangeControllerVisibleNodeIndexPaths:(ASRangeController *)rangeController
@ -420,7 +420,7 @@ static BOOL _isInterceptedSelector(SEL sel)
- (void)rangeController:(ASRangeController *)rangeController didInsertNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOption:(ASDataControllerAnimationOptions)animationOption - (void)rangeController:(ASRangeController *)rangeController didInsertNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOption:(ASDataControllerAnimationOptions)animationOption
{ {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();
if (_batchUpdateFlag) { if (_performingBatchUpdates) {
[_batchUpdateBlocks addObject:^{ [_batchUpdateBlocks addObject:^{
[super insertItemsAtIndexPaths:indexPaths]; [super insertItemsAtIndexPaths:indexPaths];
}]; }];
@ -435,7 +435,7 @@ static BOOL _isInterceptedSelector(SEL sel)
{ {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();
if (_batchUpdateFlag) { if (_performingBatchUpdates) {
[_batchUpdateBlocks addObject:^{ [_batchUpdateBlocks addObject:^{
[super deleteItemsAtIndexPaths:indexPaths]; [super deleteItemsAtIndexPaths:indexPaths];
}]; }];
@ -450,7 +450,7 @@ static BOOL _isInterceptedSelector(SEL sel)
{ {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();
if (_batchUpdateFlag) { if (_performingBatchUpdates) {
[_batchUpdateBlocks addObject:^{ [_batchUpdateBlocks addObject:^{
[super insertSections:indexSet]; [super insertSections:indexSet];
}]; }];
@ -465,7 +465,7 @@ static BOOL _isInterceptedSelector(SEL sel)
{ {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();
if (_batchUpdateFlag) { if (_performingBatchUpdates) {
[_batchUpdateBlocks addObject:^{ [_batchUpdateBlocks addObject:^{
[super deleteSections:indexSet]; [super deleteSections:indexSet];
}]; }];