2018-12-13 18:58:50 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2021-06-17 14:56:46 +00:00
|
|
|
// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
|
2018-12-13 18:58:50 +00:00
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
2018-12-14 23:12:59 +00:00
|
|
|
class CheckmarkCell: UITableViewCell {
|
2018-12-13 18:58:50 +00:00
|
|
|
var message: String {
|
|
|
|
get { return textLabel?.text ?? "" }
|
|
|
|
set(value) { textLabel!.text = value }
|
|
|
|
}
|
|
|
|
var isChecked: Bool {
|
|
|
|
didSet {
|
|
|
|
accessoryType = isChecked ? .checkmark : .none
|
|
|
|
}
|
|
|
|
}
|
2018-12-21 22:34:56 +00:00
|
|
|
|
2018-12-13 18:58:50 +00:00
|
|
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
|
|
isChecked = false
|
|
|
|
super.init(style: .default, reuseIdentifier: reuseIdentifier)
|
|
|
|
}
|
2018-12-21 22:34:56 +00:00
|
|
|
|
2018-12-13 18:58:50 +00:00
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
|
}
|
2018-12-21 22:34:56 +00:00
|
|
|
|
2018-12-13 18:58:50 +00:00
|
|
|
override func prepareForReuse() {
|
|
|
|
super.prepareForReuse()
|
|
|
|
message = ""
|
|
|
|
isChecked = false
|
|
|
|
}
|
|
|
|
}
|