12345678910111213141516171819202122232425262728 |
- //
- // KMPageEditSettingBaseView.swift
- // PDF Master
- //
- // Created by tangchao on 2023/1/12.
- //
- import Cocoa
- typealias KMPageEditSettingViewItemClick = (_ index: Int, _ value: Any) -> ()
- class KMPageEditSettingBaseView: NSView, NibLoadable {
- var itemClick: KMPageEditSettingViewItemClick?
- static var nibName: String? {
- return "KMPageEditSettingBaseWindowController"
- }
-
- 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
- }
-
- }
|