From 05d750539b91eff582ff6a789fcdcab73bb5f7bb Mon Sep 17 00:00:00 2001 From: Eric Kuck Date: Thu, 13 Dec 2018 12:58:50 -0600 Subject: Reorganized ViewControllers (split out UIViews and UITableViewCells into their own classes) All swiftlint warnings except one fixed up Signed-off-by: Eric Kuck --- .../iOS/EditTunnel/TunnelEditSectionListCell.swift | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditSectionListCell.swift (limited to 'WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditSectionListCell.swift') diff --git a/WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditSectionListCell.swift b/WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditSectionListCell.swift new file mode 100644 index 0000000..ca0352e --- /dev/null +++ b/WireGuard/WireGuard/UI/iOS/EditTunnel/TunnelEditSectionListCell.swift @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018 WireGuard LLC. All Rights Reserved. + +import UIKit + +class TunnelEditSelectionListCell: UITableViewCell { + var message: String { + get { return textLabel?.text ?? "" } + set(value) { textLabel!.text = value } + } + var isChecked: Bool { + didSet { + accessoryType = isChecked ? .checkmark : .none + } + } + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + isChecked = false + super.init(style: .default, reuseIdentifier: reuseIdentifier) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func prepareForReuse() { + super.prepareForReuse() + message = "" + isChecked = false + } +} -- cgit v1.2.3-59-g8ed1b