55 lines
1.3 KiB
Swift
55 lines
1.3 KiB
Swift
//
|
|
// TextTableViewCell.swift
|
|
// SHECommunity
|
|
//
|
|
// Created by 林 on 2024/12/5.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
/// 标题
|
|
class TextTableViewCell: UITableViewCell {
|
|
|
|
func configure(text: String) {
|
|
titleLab.text = text
|
|
}
|
|
|
|
override init(style: CellStyle, reuseIdentifier: String?) {
|
|
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
|
selectionStyle = .none
|
|
backgroundColor = .clear
|
|
setupSubviews()
|
|
}
|
|
|
|
private func setupSubviews() {
|
|
contentView.addSubview(titleLab)
|
|
|
|
titleLab.layoutChain
|
|
.edgesHorzontal(12)
|
|
.edgesVertical(8)
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
override func awakeFromNib() {
|
|
super.awakeFromNib()
|
|
// Initialization code
|
|
}
|
|
|
|
override func setSelected(_ selected: Bool, animated: Bool) {
|
|
super.setSelected(selected, animated: animated)
|
|
|
|
// Configure the view for the selected state
|
|
}
|
|
|
|
lazy var titleLab: UILabel = {
|
|
let label = UILabel()
|
|
label.textColor = ThemeManager.shared.color.titleColor
|
|
label.font = .systemFont(ofSize: 14, weight: .medium)
|
|
label.numberOfLines = 0
|
|
return label
|
|
}()
|
|
}
|