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