77 lines
11 KiB
Objective-C
77 lines
11 KiB
Objective-C
/*
|
|
* Copyright [2019] [Doric.Pub]
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
//
|
|
// DoricShowNodeTreeViewController.m
|
|
// Doric
|
|
//
|
|
// Created by jingpeng.wang on 2021/7/12.
|
|
//
|
|
#import "DoricShowNodeTreeViewCell.h"
|
|
|
|
#import <DoricCore/Doric.h>
|
|
|
|
@implementation DoricShowNodeTreeViewCell
|
|
|
|
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
|
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
|
|
|
|
if (self) {
|
|
NSString *base64 = @"iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAaZUlEQVR4Xu2dCbAuRXXH/2QRylLRQjASA0SNIlIBoyBuoBIXiCtuqEHEBQwaDUZcEncsIRjXiCaKW3AXRaMJYsAoMQmKRjFPVCIquAWEMqhlglVUUr/7eh7f++63nNPTPd98M+dUTd377jt9uvv0/Ke3s+ygoJoauL0knr0l7SLpRpJuPPVz+m+052eSfj7xc/L35v+ulvQNSd9MT81+jFb2DqPtebmO3zyBYBIMze/lalkuqQHKJGj421XLiwbHPA0EQPzvxl6S7i3pkPSTf/eZvi3pvPT8i6Tv97mxfWtbAGT5iAAAwHCP9OyzvEivOS6S9GlJ/5aeAMyC4QqAzFbOfSQ9WNI9JR3Q69e9feMAygWSPi7pn9qLG5aEAMj147mHpEekh9lijMQS7MPpuXyMCpjucwBk60zR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AAABJRU5ErkJggg==";
|
|
|
|
self.nodeIcon = [[UIImageView new] also:^(UIImageView *it) {
|
|
it.width = 20;
|
|
it.height = 20;
|
|
it.left = 5;
|
|
it.contentMode = UIViewContentModeScaleToFill;
|
|
[self.contentView addSubview:it];
|
|
|
|
NSData *imageData = [[NSData alloc] initWithBase64EncodedString:base64
|
|
options:NSDataBase64DecodingIgnoreUnknownCharacters];
|
|
it.image = [UIImage imageWithData:imageData];
|
|
|
|
it.userInteractionEnabled = YES;
|
|
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClick:)];
|
|
[it addGestureRecognizer:tapGestureRecognizer];
|
|
}];
|
|
|
|
self.nodeNameLabel = [[UILabel new] also:^(UILabel *it) {
|
|
it.contentMode = UIViewContentModeScaleToFill;
|
|
it.left = 30;
|
|
UIFont *font = it.font;
|
|
if (font) {
|
|
it.font = [it.font fontWithSize:12];
|
|
} else {
|
|
it.font = [UIFont systemFontOfSize:12];
|
|
}
|
|
[self.contentView addSubview:it];
|
|
}];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)layoutSubviews {
|
|
[super layoutSubviews];
|
|
|
|
self.nodeIcon.centerY = self.contentView.height / 2;
|
|
self.nodeNameLabel.centerY = self.contentView.height / 2;
|
|
}
|
|
|
|
- (void)onClick:(UITapGestureRecognizer *)recognizer {
|
|
|
|
}
|
|
|
|
@end
|