mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2024-12-26 11:32:37 +00:00
90acf2b220
A bit overdue, but better late than never. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
18 lines
534 B
Swift
18 lines
534 B
Swift
// SPDX-License-Identifier: MIT
|
|
// Copyright © 2018-2020 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
|
|
}
|
|
}
|