123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // KMConvertBaseView.swift
- // PDF Master
- //
- // Created by tangchao on 2023/5/11.
- //
- import Cocoa
- // 转档视图基类
- class KMConvertBaseView: NSView, NibLoadable {
-
- override func draw(_ dirtyRect: NSRect) {
- super.draw(dirtyRect)
- // Drawing code here.
- }
-
- static var nibName: String? {
- return "KMConvertBaseWindowController"
- }
-
- static func createFromNib(in bundle: Bundle = Bundle.main) -> Self? {
- guard let nibName = nibName else { return nil }
- var topLevelArray: NSArray? = nil
- bundle.loadNibNamed(NSNib.Name(nibName), owner: nil, topLevelObjects: &topLevelArray)
- guard let results = topLevelArray else { return nil }
- let views = Array<Any>(results).filter { $0 is Self }
- return views.last as? Self
- }
-
- override func awakeFromNib() {
- super.awakeFromNib()
-
- self.initSubViews()
- self.initDefaultVlaue()
- }
-
- func initDefaultVlaue() {}
- func initSubViews() {}
-
- }
|