diff options
Diffstat (limited to 'Hotline/Utility/NSWindowBridge.swift')
| -rw-r--r-- | Hotline/Utility/NSWindowBridge.swift | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Hotline/Utility/NSWindowBridge.swift b/Hotline/Utility/NSWindowBridge.swift index 5cd7197..ad56105 100644 --- a/Hotline/Utility/NSWindowBridge.swift +++ b/Hotline/Utility/NSWindowBridge.swift @@ -1,25 +1,25 @@ import SwiftUI -fileprivate class NSWindowAccessorView: NSView { - let executeBlock: (_ window: NSWindow? ) -> () - - init(_ inConfigFunction: @escaping (_ window: NSWindow? ) -> () ) { +private class NSWindowAccessorView: NSView { + let executeBlock: (_ window: NSWindow?) -> Void + + init(_ inConfigFunction: @escaping (_ window: NSWindow?) -> Void) { executeBlock = inConfigFunction - super.init( frame: NSRect() ) + super.init(frame: NSRect()) } - + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - + public override func viewDidMoveToWindow() { super.viewDidMoveToWindow() - executeBlock( self.window ) // We pass it through even if it is nil. + executeBlock(self.window) // We pass it through even if it is nil. } } public struct NSWindowAccessor: NSViewRepresentable { - var configCode: (_ window: NSWindow? ) -> () - + var configCode: (_ window: NSWindow?) -> Void + public init(_ configCode: @escaping (_: NSWindow?) -> Void) { self.configCode = configCode } - public func makeNSView(context: Context) -> NSView { return NSWindowAccessorView( configCode ) } + public func makeNSView(context: Context) -> NSView { return NSWindowAccessorView(configCode) } public func updateNSView(_ nsView: NSView, context: Context) {} } |