fix:pod validation error

This commit is contained in:
pengfei.zhou 2021-07-21 20:15:10 +08:00 committed by osborn
parent c7de1f90e2
commit 73efa3b424

View File

@ -27,6 +27,7 @@
#import <DoricCore/DoricContext.h> #import <DoricCore/DoricContext.h>
#import <DoricCore/DoricGroupNode.h> #import <DoricCore/DoricGroupNode.h>
#import <DoricCore/DoricRootNode.h> #import <DoricCore/DoricRootNode.h>
#import <DoricCore/DoricSuperNode.h>
@interface DoricShowNodeTreeViewController () <RATreeViewDelegate, RATreeViewDataSource> @interface DoricShowNodeTreeViewController () <RATreeViewDelegate, RATreeViewDataSource>
@property(nonatomic, weak) DoricContext *doricContext; @property(nonatomic, weak) DoricContext *doricContext;
@ -36,12 +37,12 @@ @implementation DoricShowNodeTreeViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.doricContext = [[DoricContextManager instance] getContext:self.contextId]; self.doricContext = [[DoricContextManager instance] getContext:self.contextId];
RATreeView *treeView = [[RATreeView alloc] initWithFrame:self.view.bounds]; RATreeView *treeView = [[RATreeView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:treeView]; [self.view addSubview:treeView];
treeView.delegate = self; treeView.delegate = self;
treeView.dataSource = self; treeView.dataSource = self;
[treeView registerClass:DoricShowNodeTreeViewCell.self forCellReuseIdentifier:@"cell"]; [treeView registerClass:DoricShowNodeTreeViewCell.self forCellReuseIdentifier:@"cell"];
@ -53,15 +54,15 @@ - (void)viewDidLoad {
- (nonnull UITableViewCell *)treeView:(nonnull RATreeView *)treeView cellForItem:(nullable id)item { - (nonnull UITableViewCell *)treeView:(nonnull RATreeView *)treeView cellForItem:(nullable id)item {
DoricShowNodeTreeViewCell *cell = [treeView dequeueReusableCellWithIdentifier:@"cell"]; DoricShowNodeTreeViewCell *cell = [treeView dequeueReusableCellWithIdentifier:@"cell"];
DoricViewNode *viewNode = (DoricViewNode *)item; DoricViewNode *viewNode = (DoricViewNode *) item;
NSString *type = viewNode.type; NSString *type = viewNode.type;
if ([item isKindOfClass:[DoricRootNode class]]) { if ([item isKindOfClass:[DoricRootNode class]]) {
type = @"Root"; type = @"Root";
} }
NSString *viewId = [[@" <" stringByAppendingString:viewNode.viewId] stringByAppendingString:@"> "]; NSString *viewId = [[@" <" stringByAppendingString:viewNode.viewId] stringByAppendingString:@"> "];
NSString *value = [type stringByAppendingString:viewId]; NSString *value = [type stringByAppendingString:viewId];
if ([item isKindOfClass:[DoricGroupNode class]]) { if ([item isKindOfClass:[DoricGroupNode class]]) {
DoricGroupNode *groupNode = item; DoricGroupNode *groupNode = item;
@ -70,17 +71,17 @@ - (nonnull UITableViewCell *)treeView:(nonnull RATreeView *)treeView cellForItem
} else if ([item isKindOfClass:[DoricSuperNode class]]) { } else if ([item isKindOfClass:[DoricSuperNode class]]) {
DoricSuperNode *superNode = item; DoricSuperNode *superNode = item;
NSArray *viewIds = [superNode getSubNodeViewIds]; NSArray *viewIds = [superNode getSubNodeViewIds];
NSString *childDesc = [[@"(" stringByAppendingString:[@(viewIds.count)stringValue]] stringByAppendingString:@" Child)"]; NSString *childDesc = [[@"(" stringByAppendingString:[@(viewIds.count) stringValue]] stringByAppendingString:@" Child)"];
value = [value stringByAppendingString:childDesc]; value = [value stringByAppendingString:childDesc];
} }
cell.nodeNameLabel.text = value; cell.nodeNameLabel.text = value;
[cell.nodeNameLabel sizeToFit]; [cell.nodeNameLabel sizeToFit];
NSInteger indent = [treeView levelForCellForItem:item]; NSInteger indent = [treeView levelForCellForItem:item];
cell.nodeIcon.left = 5 + indent * 15; cell.nodeIcon.left = 5 + indent * 15;
cell.nodeNameLabel.left = 30 + indent * 15; cell.nodeNameLabel.left = 30 + indent * 15;
return cell; return cell;
} }