// // KMHeaderFooterAdjectiveInfoBaseView.swift // PDF Master // // Created by tangchao on 2022/12/27. // import Cocoa typealias KMHeaderFooterAdjectiveInfoItemClick = (_ index: Int,_ value: Any) -> () class KMHeaderFooterAdjectiveInfoBaseView: NSView { var titleLabel = NSTextField(labelWithString: "") var contentInset = NSEdgeInsets(top: 0, left: 16, bottom: 0, right: 16) private var myModel: KMHeaderFooterAdjectiveModel! var model: KMHeaderFooterAdjectiveModel { get { return myModel } set { myModel = newValue } } var itemClick: KMHeaderFooterAdjectiveInfoItemClick! override init(frame frameRect: NSRect) { super.init(frame: frameRect) initSubviews() } required init?(coder: NSCoder) { super.init(coder: coder) initSubviews() } override var isFlipped: Bool { return true } func initSubviews() { self.addSubview(self.titleLabel) } override func layout() { super.layout() self.titleLabel.frame = NSMakeRect(self.contentInset.left, 0, NSWidth(self.bounds)-self.contentInset.left-self.contentInset.right, 20) } }