macOS: Manage tunnels window: Tunnels list

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander
2019-01-02 01:07:46 +05:30
parent 98e9088aba
commit 7934d6b0c7
6 changed files with 240 additions and 1 deletions
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: MIT
// Copyright © 2018 WireGuard LLC. All Rights Reserved.
import Cocoa
extension NSTableView {
func dequeueReusableCell<T: NSView>() -> T {
let identifier = NSUserInterfaceItemIdentifier(NSStringFromClass(T.self))
if let cellView = makeView(withIdentifier: identifier, owner: self) {
//swiftlint:disable:next force_cast
return cellView as! T
}
let cellView = T()
cellView.identifier = identifier
return cellView
}
}