Not animated for end updates if animation is already going on within ASTableView

Fix strange artifacts in ASTableView are visible when changing the device orientation or other animations are going on while calling endUpdates
This commit is contained in:
Michael Schneider
2016-11-22 14:16:35 -08:00
parent 60756a1da5
commit 1f7b838d5e
3 changed files with 15 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#import "ASInternalHelpers.h"
#import "ASLayout.h"
#import "_ASDisplayLayer.h"
#import "_ASCoreAnimationExtras.h"
#import "ASTableNode.h"
#import "ASEqualityHelpers.h"
#import "ASTableView+Undeprecated.h"
@@ -610,7 +611,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
} else {
[self beginUpdates];
[_dataController relayoutAllNodes];
[self endUpdates];
[self endUpdatesAnimated:(ASDisplayNodeLayerHasAnimations(self.layer) == NO) completion:nil];
}
}
@@ -1583,7 +1584,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
// If the node height changed, trigger a height requery.
if (oldSize.height != calculatedSize.height) {
[self beginUpdates];
[self endUpdates];
[self endUpdatesAnimated:(ASDisplayNodeLayerHasAnimations(self.layer) == NO) completion:nil];
}
}
}