diff options
author | Eric Kuck <eric@bluelinelabs.com> | 2018-12-12 15:33:14 -0600 |
---|---|---|
committer | Eric Kuck <eric@bluelinelabs.com> | 2018-12-12 15:33:14 -0600 |
commit | e4ac48bc75064c0e144020ded1ed877d226742c8 (patch) | |
tree | ffee70e6c957a717cc8a6b805e6cefa59ed05bc7 /WireGuard/WireGuard/UI/iOS/UITableViewCell+Reuse.swift | |
parent | Tons more swiftlint warnings fixed. Still a few remaining. (diff) | |
download | wireguard-apple-e4ac48bc75064c0e144020ded1ed877d226742c8.tar.xz wireguard-apple-e4ac48bc75064c0e144020ded1ed877d226742c8.zip |
More linter warnings fixed, enabled more swiftlint rules, project cleanup
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/UITableViewCell+Reuse.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/UITableViewCell+Reuse.swift | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/UITableViewCell+Reuse.swift b/WireGuard/WireGuard/UI/iOS/UITableViewCell+Reuse.swift new file mode 100644 index 0000000..587f7b1 --- /dev/null +++ b/WireGuard/WireGuard/UI/iOS/UITableViewCell+Reuse.swift @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018 WireGuard LLC. All Rights Reserved. + +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) + } + + func dequeueReusableCell<T: UITableViewCell>(for indexPath: IndexPath) -> T { + //swiftlint:disable:next force_cast + return dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as! T + } +} |