-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
444 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
StreetDrop/StreetDrop/Presentation/MyPage/View/FilterModal/CityTableViewCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// | ||
// CityTableViewCell.swift | ||
// StreetDrop | ||
// | ||
// Created by 차요셉 on 8/5/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
|
||
final class CityTableViewCell: UITableViewCell { | ||
static let identifier = "StateTableViewCell" | ||
|
||
override func setSelected(_ selected: Bool, animated: Bool) { | ||
super.setSelected(selected, animated: animated) | ||
contentView.backgroundColor = selected ? .gray800 : .gray900 | ||
nameLabel.textColor = selected ? .textPrimary : .gray400 | ||
} | ||
|
||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
configureUI() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private let nameLabel: UILabel = { | ||
let label: UILabel = .init() | ||
label.font = .pretendard(size: 16, weight: 500) | ||
label.numberOfLines = 1 | ||
label.textColor = .gray400 | ||
label.setLineHeight(lineHeight: 24) | ||
|
||
return label | ||
}() | ||
|
||
private let countLabel: UILabel = { | ||
let label: UILabel = .init() | ||
label.font = .pretendard(size: 16, weightName: .medium) | ||
label.numberOfLines = 1 | ||
label.textColor = .textPrimary | ||
label.setLineHeight(lineHeight: 24) | ||
|
||
return label | ||
}() | ||
|
||
private let bottomView: UIView = { | ||
let view: UIView = .init() | ||
view.backgroundColor = .gray800 | ||
|
||
return view | ||
}() | ||
|
||
func configure(regionName: String) { | ||
nameLabel.text = regionName | ||
} | ||
} | ||
|
||
private extension CityTableViewCell { | ||
func configureUI() { | ||
contentView.backgroundColor = .gray900 | ||
|
||
[ | ||
nameLabel, | ||
bottomView | ||
].forEach { | ||
contentView.addSubview($0) | ||
} | ||
|
||
nameLabel.snp.makeConstraints { | ||
$0.centerY.equalToSuperview() | ||
$0.leading.equalToSuperview().inset(24) | ||
} | ||
|
||
bottomView.snp.makeConstraints { | ||
$0.height.equalTo(1) | ||
$0.horizontalEdges.bottom.equalToSuperview() | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
StreetDrop/StreetDrop/Presentation/MyPage/View/FilterModal/GuTableViewCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// GuTableViewCell.swift | ||
// StreetDrop | ||
// | ||
// Created by 차요셉 on 12/20/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import SnapKit | ||
|
||
final class GuTableViewCell: UITableViewCell { | ||
static let identifier = "GuTableViewCell" | ||
|
||
override func setSelected(_ selected: Bool, animated: Bool) { | ||
super.setSelected(selected, animated: animated) | ||
nameLabel.textColor = selected ? .textPrimary : .gray400 | ||
} | ||
|
||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
configureUI() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder aDecoder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private let nameLabel: UILabel = { | ||
let label: UILabel = .init() | ||
label.font = .pretendard(size: 16, weightName: .medium) | ||
label.textColor = .gray400 | ||
label.numberOfLines = 1 | ||
label.setLineHeight(lineHeight: 24) | ||
label.textAlignment = .center | ||
|
||
return label | ||
}() | ||
|
||
func configure(regionName: String) { | ||
nameLabel.text = regionName | ||
} | ||
} | ||
|
||
private extension GuTableViewCell { | ||
func configureUI() { | ||
backgroundColor = .gray600 | ||
|
||
addSubview(nameLabel) | ||
|
||
nameLabel.snp.makeConstraints { | ||
$0.centerY.equalToSuperview() | ||
$0.horizontalEdges.equalToSuperview() | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.