Skip to content

Commit

Permalink
[Fix] #8 - UILabel Extension 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
0seoYun committed Dec 15, 2023
1 parent 7a83606 commit 2e1497f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,20 @@ class DetailCollectionViewCell: UICollectionViewCell {
}

private func setStyle() {
locationLabel.do {
$0.font = .sfRegular(size: 36)
$0.textColor = .white
}
locationLabel.setupLabel(font: .sfRegular(size: 36), textColor: .white)

temperatureLabel.do {
$0.font = .sfThin(size: 102)
$0.textColor = .white
}
temperatureLabel.setupLabel(font: .sfThin(size: 102), textColor: .white)

conditionLabel.do {
$0.font = .sfRegular(size: 24)
$0.textColor = .white
}
conditionLabel.setupLabel(font: .sfRegular(size: 24), textColor: .white)

temperatureStackView.do {
$0.axis = .horizontal
$0.spacing = 8
$0.distribution = .equalSpacing
}

minTemperatureLabel.do {
$0.font = .sfMedium(size: 20)
$0.textColor = .white
}

maxTemperatureLabel.do {
$0.font = .sfMedium(size: 20)
$0.textColor = .white
}

minTemperatureLabel.setupLabel(font: .sfMedium(size: 20), textColor: .white)

maxTemperatureLabel.setupLabel(font: .sfMedium(size: 20), textColor: .white)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ class TenDaysForecastCollectionViewCell: UICollectionViewCell {


private func setStyle() {
dayNameLabel.do {
$0.font = .sfMedium(size: 22)
$0.textColor = .white
}
dayNameLabel.setupLabel(font: .sfMedium(size: 22), textColor: .white)

conditionStackView.do {
$0.axis = .vertical
Expand All @@ -82,20 +79,11 @@ class TenDaysForecastCollectionViewCell: UICollectionViewCell {
$0.tintColor = .white
}

precipPercentLabel.do {
$0.font = .sfMedium(size: 15)
$0.textColor = UIColor(red: 0.506, green: 0.812, blue: 0.98, alpha: 1)
}

minTempLabel.do {
$0.font = .sfMedium(size: 22)
$0.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1)
}
precipPercentLabel.setupLabel(font: .sfMedium(size: 15), textColor: UIColor(red: 0.506, green: 0.812, blue: 0.98, alpha: 1))

minTempLabel.setupLabel(font: .sfMedium(size: 22), textColor: UIColor(red: 1, green: 1, blue: 1, alpha: 1))

maxTempLabel.do {
$0.font = .sfMedium(size: 22)
$0.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1)
}
maxTempLabel.setupLabel(font: .sfMedium(size: 22), textColor: UIColor(red: 1, green: 1, blue: 1, alpha: 1))
}

func bindData(data: TenDaysForecastData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,9 @@ class TodayForecastCollectionViewCell: UICollectionViewCell {
$0.distribution = .equalSpacing
}

timeLabel.do {
$0.font = .sfMedium(size: 17)
$0.textColor = .white
$0.textAlignment = .center
}
timeLabel.setupLabel(font: .sfMedium(size: 17), textColor: .white)

temperatureLabel.do {
$0.font = .sfMedium(size: 17)
$0.textColor = .white
$0.textAlignment = .center
}
temperatureLabel.setupLabel(font: .sfMedium(size: 17), textColor: .white)

self.contentView.do {
$0.backgroundColor = .clear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ class TenDaysCollectionHeaderView: UICollectionReusableView {
$0.tintColor = UIColor.lightGray
}

headerTextLabel.do {
$0.text = "10일간의 일기예보"
$0.font = .sfMedium(size: 15)
$0.textColor = UIColor.lightGray
}
headerTextLabel.setupLabel(font: .sfMedium(size: 15), text:"10일간의 일기예보", textColor: UIColor.lightGray )
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ class TodayCollectionHeaderView: UICollectionReusableView {
$0.tintColor = UIColor.lightGray
}

headerTextLabel.do {
$0.text = "시간별 일기예보"
$0.font = .sfMedium(size: 15)
$0.textColor = UIColor.lightGray
}
headerTextLabel.setupLabel(font: .sfMedium(size: 15), text: "시간별 일기예보", textColor: UIColor.lightGray)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,12 @@ class CardCollectionViewCell: UICollectionViewCell {
$0.isUserInteractionEnabled = true
}

location.do {
$0.font = .sfBold(size: 24)
$0.textColor = .white
}

currentTime.do {
$0.font = .sfMedium(size: 17)
$0.textColor = .white
}

currentCondition.do {
$0.font = .sfMedium(size: 16)
$0.textColor = .white
}

maxTemperature.do {
$0.font = .sfMedium(size: 15)
$0.textColor = .white
}

minTemperature.do {
$0.font = .sfMedium(size: 15)
$0.textColor = .white
}

currentTemperature.do {
$0.font = .sfLight(size: 52)
$0.textColor = .white
}
location.setupLabel(font: .sfBold(size: 24), textColor: .white)
currentTime.setupLabel(font: .sfMedium(size: 17), textColor: .white)
currentCondition.setupLabel(font: .sfMedium(size: 16), textColor: .white)
maxTemperature.setupLabel(font: .sfMedium(size: 15), textColor: .white)
minTemperature.setupLabel(font: .sfMedium(size: 15), textColor: .white)
currentTemperature.setupLabel(font: .sfLight(size: 52), textColor: .white)
}

func configureCell(data: WeatherListModel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,39 +75,12 @@ class WeatherCardView: UIButton {
$0.layer.cornerRadius = 16
$0.isUserInteractionEnabled = true
}

myLocation.do {
$0.text = "나의 위치"
$0.font = .sfBold(size: 24)
$0.textColor = .white
}

currentLocation.do {
$0.text = "고양시"
$0.font = .sfMedium(size: 17)
$0.textColor = .white
}

currentCondition.do {
$0.text = "흐림"
$0.font = .sfMedium(size: 16)
$0.textColor = .white
}

maxTemperature.do {
$0.text = "최고:29°"
$0.font = .sfMedium(size: 15)
$0.textColor = .white
}
minTemperature.do {
$0.text = "최저:15°"
$0.font = .sfMedium(size: 15)
$0.textColor = .white
}
currentTemperature.do {
$0.text = "21°"
$0.font = .sfLight(size: 52)
$0.textColor = .white
}

myLocation.setupLabel(font: .sfBold(size: 24), textColor: .white)
currentLocation.setupLabel(font: .sfMedium(size: 17), textColor: .white)
currentCondition.setupLabel(font: .sfMedium(size: 16), textColor: .white)
maxTemperature.setupLabel(font: .sfMedium(size: 15), textColor: .white)
minTemperature.setupLabel(font: .sfMedium(size: 15), textColor: .white)
currentTemperature.setupLabel(font: .sfLight(size: 52), textColor: .white)
}
}

0 comments on commit 2e1497f

Please sign in to comment.