iOS: fix blend viewModel error
This commit is contained in:
parent
46609aee4c
commit
9757a6e8c6
@ -69,25 +69,24 @@ - (void)recursiveMixin:(NSDictionary *)srcModel to:(NSMutableDictionary *)target
|
|||||||
NSDictionary *srcProp = srcModel[@"props"];
|
NSDictionary *srcProp = srcModel[@"props"];
|
||||||
NSMutableDictionary *targetProp = targetModel[@"props"];
|
NSMutableDictionary *targetProp = targetModel[@"props"];
|
||||||
NSMutableArray *targetOri = targetProp[@"subviews"];
|
NSMutableArray *targetOri = targetProp[@"subviews"];
|
||||||
|
NSArray *srcSubviews = srcProp[@"subviews"];
|
||||||
[srcProp enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) {
|
if (srcSubviews && srcSubviews.count > 0) {
|
||||||
if ([@"subviews" isEqualToString:key]) {
|
for (NSDictionary *subview in srcSubviews) {
|
||||||
NSArray *subviews = obj;
|
NSString *viewId = subview[@"id"];
|
||||||
if (subviews) {
|
__block NSMutableDictionary *viewModel = nil;
|
||||||
for (NSDictionary *subview in subviews) {
|
[targetOri enumerateObjectsUsingBlock:^(NSMutableDictionary *obj, NSUInteger idx, BOOL *stop) {
|
||||||
NSString *viewId = subview[@"id"];
|
if ([viewId isEqualToString:obj[@"id"]]) {
|
||||||
NSMutableArray *mutableTargetOri = [targetProp[@"subviews"] mutableCopy];
|
viewModel = obj;
|
||||||
[mutableTargetOri enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) {
|
*stop = YES;
|
||||||
if ([viewId isEqualToString:obj[@"id"]]) {
|
|
||||||
NSMutableDictionary *mutableDictionary = [obj mutableCopy];
|
|
||||||
[self recursiveMixin:subview to:mutableDictionary];
|
|
||||||
targetOri[idx] = [mutableDictionary copy];
|
|
||||||
*stop = YES;
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
}];
|
||||||
|
if (viewModel) {
|
||||||
|
[self recursiveMixin:subview to:viewModel];
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
[srcProp enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) {
|
||||||
|
if (![@"subviews" isEqualToString:key]) {
|
||||||
targetProp[key] = obj;
|
targetProp[key] = obj;
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
Reference in New Issue
Block a user