iOS: fix listItem cannot be animated

This commit is contained in:
pengfei.zhou 2021-12-03 17:33:22 +08:00 committed by osborn
parent c3093d9ff2
commit 0477e5790b
2 changed files with 38 additions and 38 deletions

View File

@ -293,7 +293,6 @@ - (DoricViewNode *)subNodeWithViewId:(NSString *)viewId {
}
- (void)blendSubNode:(NSDictionary *)subModel {
dispatch_async(dispatch_get_main_queue(), ^{
NSString *viewId = subModel[@"id"];
DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
BOOL skipReload = NO;
@ -313,6 +312,7 @@ - (void)blendSubNode:(NSDictionary *)subModel {
if (skipReload) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
[self.itemViewIds enumerateKeysAndObjectsUsingBlock:^(NSNumber *_Nonnull key, NSString *_Nonnull obj, BOOL *_Nonnull stop) {
if ([viewId isEqualToString:obj]) {
*stop = YES;

View File

@ -280,7 +280,6 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position {
- (void)blendSubNode:(NSDictionary *)subModel {
///Here async blend sub node because the item count need to be applied first.
NSUInteger currentCount = self.itemCount + (self.loadMore ? 1 : 0);
dispatch_async(dispatch_get_main_queue(), ^{
NSString *viewId = subModel[@"id"];
DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
BOOL skipReload = NO;
@ -300,6 +299,7 @@ - (void)blendSubNode:(NSDictionary *)subModel {
if (skipReload) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
[self.itemViewIds enumerateKeysAndObjectsUsingBlock:^(NSNumber *_Nonnull key, NSString *_Nonnull obj, BOOL *_Nonnull stop) {
if ([viewId isEqualToString:obj]) {
*stop = YES;