add view id display

This commit is contained in:
王劲鹏 2021-07-15 14:51:19 +08:00 committed by osborn
parent 269f83775b
commit c49bfadb9c
4 changed files with 57 additions and 38 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -38,4 +38,6 @@
- (DoricViewNode *)subNodeWithViewId:(NSString *)viewId;
- (void)recursiveMixin:(NSDictionary *)srcModel to:(NSMutableDictionary *)targetModel;
@end
- (NSArray *)getSubNodeViewIds;
@end

View File

@ -128,4 +128,20 @@ - (DoricViewNode *)subNodeWithViewId:(NSString *)viewId {
NSStringFromSelector(_cmd));
return nil;
}
- (NSArray *)getSubNodeViewIds {
NSMutableArray *discardedItems = [NSMutableArray array];
NSMutableArray *allKeys = [[NSMutableArray alloc]init];
allKeys = [NSMutableArray arrayWithArray:[self.subNodes allKeys]];
for (NSString *key in allKeys) {
if ([self subNodeWithViewId:key] == nil) {
[discardedItems addObject:key];
}
}
[allKeys removeObjectsInArray:discardedItems];
return allKeys;
}
@end