2018-12-12 21:33:14 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2021-06-17 14:56:46 +00:00
|
|
|
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
|
2018-12-12 21:33:14 +00:00
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
extension UITableViewCell {
|
|
|
|
static var reuseIdentifier: String {
|
|
|
|
return NSStringFromClass(self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension UITableView {
|
|
|
|
func register<T: UITableViewCell>(_: T.Type) {
|
|
|
|
register(T.self, forCellReuseIdentifier: T.reuseIdentifier)
|
|
|
|
}
|
2018-12-13 04:26:04 +00:00
|
|
|
|
2018-12-12 21:33:14 +00:00
|
|
|
func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath) -> T {
|
2021-08-02 08:19:47 +00:00
|
|
|
// swiftlint:disable:next force_cast
|
2018-12-12 21:33:14 +00:00
|
|
|
return dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T
|
|
|
|
}
|
|
|
|
}
|