17 lines
389 B
Swift
17 lines
389 B
Swift
|
import Foundation
|
||
|
import AppKit
|
||
|
|
||
|
class ExportAccessoryView : NSView {
|
||
|
|
||
|
}
|
||
|
|
||
|
extension NSView {
|
||
|
class func fromNib<T: NSView>() -> T? {
|
||
|
var topLevelObjects : NSArray?
|
||
|
guard Bundle.main.loadNibNamed("\(self)", owner: nil, topLevelObjects: &topLevelObjects) else {
|
||
|
return nil
|
||
|
}
|
||
|
return topLevelObjects!.first(where: { $0 is T }) as? T
|
||
|
}
|
||
|
}
|