Skip to content

Commit

Permalink
[Fix] weater forecast recommendations to look better and to not recom…
Browse files Browse the repository at this point in the history
…mend when it rains
  • Loading branch information
thoonk committed Mar 31, 2021
1 parent 11daf41 commit 26f0c2d
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 101 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "dog-paw-print-30.png",
"filename" : "check-mark-48.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
157 changes: 87 additions & 70 deletions WalkMyDog/WalkMyDog/App/Asset/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions WalkMyDog/WalkMyDog/Models/ParticlesMatter/PMModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by 김태훈 on 2021/02/16.
//

import Foundation

enum RCMDCriteria: Int {
case none = -1
case love = 0
Expand Down Expand Up @@ -65,25 +63,25 @@ struct PMModel {
case RCMDCriteria.love, RCMDCriteria.happy:
return "산책을 나가기 좋은 날씨에요!!"
case RCMDCriteria.bad:
return "산책을 웬만하면 나가지 마세요:("
return "오늘은 웬만하면 나가지 마세요:("
case RCMDCriteria.worst:
return "이불 밖은 위험해요!!"
default:
return "산책 추천이 비활성되어 있습니다."
}
}

var rcmdImage: String {
switch pmStatus {
case RCMDCriteria.love, RCMDCriteria.happy:
return "dog-park-96"
return "check-mark-48"
case RCMDCriteria.bad, RCMDCriteria.worst:
return "dog-home-100"
return ""
default:
return "puzzled-96"
return ""
}
}

var pm10Image: String {
switch pm10 {
case 0...30.99:
Expand Down
13 changes: 12 additions & 1 deletion WalkMyDog/WalkMyDog/Scenes/Weather/WeatherTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class WeatherTableViewCell: UITableViewCell {
@IBOutlet weak var launchPM25ImageView: UIImageView!
@IBOutlet weak var dinnerPM25ImageView: UIImageView!
@IBOutlet weak var rcmdImageView: UIImageView!
@IBOutlet weak var morningRcmdImageView: UIImageView!
@IBOutlet weak var launchRcmdImageView: UIImageView!
@IBOutlet weak var dinnerRcmdImageView: UIImageView!

override func awakeFromNib() {
super.awakeFromNib()
Expand Down Expand Up @@ -48,6 +51,14 @@ class WeatherTableViewCell: UITableViewCell {
dinnerPM10ImageView.image = UIImage(named: dinnerPM.pm10Image)
dinnerPM25ImageView.image = UIImage(named: dinnerPM.pm25Image)

rcmdImageView.image = UIImage(named: data.weekPM![1].rcmdImage)
if data.weekWeather?.conditionId ?? 0 <= 531 {
morningRcmdImageView.image = nil
launchRcmdImageView.image = nil
dinnerRcmdImageView.image = nil
} else {
morningRcmdImageView.image = UIImage(named: morningPM.rcmdImage)
launchRcmdImageView.image = UIImage(named: launchPM.rcmdImage)
dinnerRcmdImageView.image = UIImage(named: dinnerPM.rcmdImage)
}
}
}

0 comments on commit 26f0c2d

Please sign in to comment.