diff options
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/Settings/SettingsKeyValueCell.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/Settings/SettingsKeyValueCell.swift | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/Settings/SettingsKeyValueCell.swift b/WireGuard/WireGuard/UI/iOS/Settings/SettingsKeyValueCell.swift new file mode 100644 index 0000000..532f1d1 --- /dev/null +++ b/WireGuard/WireGuard/UI/iOS/Settings/SettingsKeyValueCell.swift @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018 WireGuard LLC. All Rights Reserved. + +import UIKit + +class SettingsKeyValueCell: UITableViewCell { + var key: String { + get { return textLabel?.text ?? "" } + set(value) { textLabel?.text = value } + } + var value: String { + get { return detailTextLabel?.text ?? "" } + set(value) { detailTextLabel?.text = value } + } + + override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { + super.init(style: .value1, reuseIdentifier: SettingsKeyValueCell.reuseIdentifier) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func prepareForReuse() { + super.prepareForReuse() + key = "" + value = "" + } +} |