Never use setAnimationsEnabled: so we don't risk corrupting enabledness

This commit is contained in:
Adlai Holler
2015-10-28 16:09:56 -07:00
parent f11b6ac914
commit 50485663b9
3 changed files with 26 additions and 40 deletions

View File

@@ -789,26 +789,14 @@ static BOOL _isInterceptedSelector(SEL sel)
}
return; // if the asyncDataSource has become invalid while we are processing, ignore this request to avoid crashes
}
BOOL animationsEnabled = NO;
if (!animated) {
animationsEnabled = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
}
[super performBatchUpdates:^{
[_batchUpdateBlocks enumerateObjectsUsingBlock:^(dispatch_block_t block, NSUInteger idx, BOOL *stop) {
block();
}];
} completion:^(BOOL finished) {
if (!animated) {
[UIView setAnimationsEnabled:animationsEnabled];
}
if (completion) {
completion(finished);
}
}];
ASPerformBlockWithoutAnimation(!animated, ^{
[super performBatchUpdates:^{
[_batchUpdateBlocks enumerateObjectsUsingBlock:^(dispatch_block_t block, NSUInteger idx, BOOL *stop) {
block();
}];
} completion:completion];
});
[_batchUpdateBlocks removeAllObjects];
_performingBatchUpdates = NO;