mirror of
https://git.zx2c4.com/wireguard-apple
synced 2025-08-12 17:52:53 +00:00
35 lines
894 B
Swift
35 lines
894 B
Swift
// SPDX-License-Identifier: MIT
|
|
// Copyright © 2018-2023 WireGuard LLC. All Rights Reserved.
|
|
|
|
import UIKit
|
|
|
|
class TextCell: UITableViewCell {
|
|
var message: String {
|
|
get { return textLabel?.text ?? "" }
|
|
set(value) { textLabel!.text = value }
|
|
}
|
|
|
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
super.init(style: .default, reuseIdentifier: reuseIdentifier)
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
func setTextColor(_ color: UIColor) {
|
|
textLabel?.textColor = color
|
|
}
|
|
|
|
func setTextAlignment(_ alignment: NSTextAlignment) {
|
|
textLabel?.textAlignment = alignment
|
|
}
|
|
|
|
override func prepareForReuse() {
|
|
super.prepareForReuse()
|
|
message = ""
|
|
setTextColor(.label)
|
|
setTextAlignment(.left)
|
|
}
|
|
}
|