From 7637a820e58cdc0d2687d487e5c30eb8051a93d8 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 22 Oct 2021 16:08:15 +0800 Subject: [PATCH] iOS: fix when init NSAttributedString cause it runs blocks on main queue immediately --- doric-iOS/Pod/Classes/Shader/DoricSuperNode.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m b/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m index 1dca5186..14552434 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricSuperNode.m @@ -57,17 +57,18 @@ - (void)mixinSubNode:(NSMutableDictionary *)dictionary { - (void)mixin:(NSDictionary *)srcModel to:(NSMutableDictionary *)targetModel { NSDictionary *srcProp = srcModel[@"props"]; - NSMutableDictionary *targetProp = targetModel[@"props"]; + NSMutableDictionary *targetProp = [targetModel[@"props"] mutableCopy]; [srcProp enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { if (![@"subviews" isEqualToString:key]) { targetProp[key] = obj; } }]; + targetModel[@"props"] = targetProp; } - (void)recursiveMixin:(NSDictionary *)srcModel to:(NSMutableDictionary *)targetModel { NSDictionary *srcProp = srcModel[@"props"]; - NSMutableDictionary *targetProp = targetModel[@"props"]; + NSMutableDictionary *targetProp = [targetModel[@"props"] mutableCopy]; NSMutableArray *targetOri = targetProp[@"subviews"]; NSArray *srcSubviews = srcProp[@"subviews"]; if (srcSubviews && srcSubviews.count > 0) { @@ -90,6 +91,7 @@ - (void)recursiveMixin:(NSDictionary *)srcModel to:(NSMutableDictionary *)target targetProp[key] = obj; } }]; + targetModel[@"props"] = targetProp; } - (void)blendSubNode:(DoricViewNode *)subNode layoutConfig:(NSDictionary *)layoutConfig {