// // AccountRightListCellView.swift // PDF Reader Pro // // Created by User-Tangchao on 2024/10/28. // import Cocoa class AccountRightListCellView: NSTableCellView { lazy var iconIv: NSImageView = { let view = NSImageView() return view }() lazy var label: NSTextField = { let view = NSTextField(wrappingLabelWithString: "") return view }() override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) // Drawing code here. } convenience init() { self.init(frame: .init(x: 0, y: 0, width: 200, height: 34)) initSubviews() initDefaultValue() } override func awakeFromNib() { super.awakeFromNib() initSubviews() initDefaultValue() } func initSubviews() { addSubview(iconIv) addSubview(label) iconIv.km_add_left_constraint(constant: 0) iconIv.km_add_size_constraint(size: .init(width: 20, height: 20)) iconIv.km_add_centerY_constraint() label.km_add_centerY_constraint() label.km_add_leading_constraint(equalTo: iconIv, attribute: .trailing, constant: 10) } func initDefaultValue() { } }