feat:async blend sub node of list

This commit is contained in:
pengfei.zhou 2019-12-10 19:54:53 +08:00
parent c23d5c5391
commit 0889a57a68

View File

@ -182,11 +182,17 @@ - (NSDictionary *)itemModelAt:(NSUInteger)position {
NSUInteger pos = position + idx; NSUInteger pos = position + idx;
self.itemViewIds[@(pos)] = thisViewId; self.itemViewIds[@(pos)] = thisViewId;
}]; }];
if (array.count > 0) {
return array[0]; return array[0];
} else {
return nil;
}
} }
} }
- (void)blendSubNode:(NSDictionary *)subModel { - (void)blendSubNode:(NSDictionary *)subModel {
///Here async blend sub node because the item count need to be applied first.
dispatch_async(dispatch_get_main_queue(), ^{
NSString *viewId = subModel[@"id"]; NSString *viewId = subModel[@"id"];
DoricViewNode *viewNode = [self subNodeWithViewId:viewId]; DoricViewNode *viewNode = [self subNodeWithViewId:viewId];
if (viewNode) { if (viewNode) {
@ -205,6 +211,8 @@ - (void)blendSubNode:(NSDictionary *)subModel {
}]; }];
} }
}]; }];
});
} }
- (void)callItem:(NSUInteger)position height:(CGFloat)height { - (void)callItem:(NSUInteger)position height:(CGFloat)height {