By default, capture the current animation enabledness for collection/table updates (#2827)

This commit is contained in:
Adlai Holler 2016-12-23 09:46:49 -05:00 committed by GitHub
parent c1157084ca
commit 2ea7d4c1c0
2 changed files with 4 additions and 2 deletions

View File

@ -749,7 +749,8 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion
{
[self performBatchAnimated:YES updates:updates completion:completion];
// We capture the current state of whether animations are enabled if they don't provide us with one.
[self performBatchAnimated:[UIView areAnimationsEnabled] updates:updates completion:completion];
}
- (void)registerSupplementaryNodeOfKind:(NSString *)elementKind

View File

@ -625,7 +625,8 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
- (void)endUpdates
{
[self endUpdatesAnimated:YES completion:nil];
// We capture the current state of whether animations are enabled if they don't provide us with one.
[self endUpdatesAnimated:[UIView areAnimationsEnabled] completion:nil];
}
- (void)endUpdatesAnimated:(BOOL)animated completion:(void (^)(BOOL completed))completion;