Files
comaps/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryCell.swift
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

35 lines
1.0 KiB
Swift

final class SearchHistoryCell: MWMTableViewCell {
enum Content {
case query(String)
case clear
}
static private let placeholderImage = UIImage.filled(with: .clear, size: CGSize(width: 28, height: 28))
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: .default, reuseIdentifier: reuseIdentifier)
setStyle(.defaultTableViewCell)
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func configure(for content: Content) {
switch content {
case .query(let query):
textLabel?.text = query
textLabel?.setFontStyleAndApply(.regular17, color: .blackSecondary)
imageView?.image = UIImage(resource: .icSearch)
imageView?.setStyleAndApply(.black)
isSeparatorHidden = false
case .clear:
textLabel?.text = L("clear_search")
textLabel?.setFontStyleAndApply(.regular14, color: .linkBlue)
imageView?.image = Self.placeholderImage
isSeparatorHidden = true
}
}
}