// // 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(results).filter { $0 is Self } return views.last as? Self } }