Skip to content

Commit

Permalink
[Feat] TeamSparker#258 - 습관방 티켓 태그 이미지 분기처리
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun99999 committed Feb 16, 2022
1 parent 09b8a14 commit 398ba2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Spark-iOS/Spark-iOS/Source/Cells/Home/HomeHabitCVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HomeHabitCVC: UICollectionViewCell {
// MARK: - Properties

@frozen
private enum State: String {
private enum Status: String {
case none = "NONE"
case rest = "REST"
case done = "DONE"
Expand Down Expand Up @@ -105,7 +105,7 @@ extension HomeHabitCVC {
leftDay: Int,
profileImg: [String?],
life: Int,
state: String,
status: String,
memberNum: Int,
doneMemberNum: Int) {
if leftDay == 0 {
Expand Down Expand Up @@ -148,8 +148,8 @@ extension HomeHabitCVC {
fourthProfileImage.isHidden = true
restLabel.isHidden = true

guard let state = State(rawValue: state) else { return }
switch state {
guard let status = Status(rawValue: status) else { return }
switch status {
case .none:
tagImage.isHidden = true
ticketImage.image = UIImage(named: "property1TicketRight4")
Expand Down
7 changes: 4 additions & 3 deletions Spark-iOS/Spark-iOS/Source/NetworkModels/Home/HabitRoom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ struct Room: Codable {
let leftDay: Int?
let profileImg: [String?]
let life: Int?
// isStarted: 습관방 시작했는지 여부. isDone: 인증 완료 여부.
let isStarted, isDone: Bool
// isStarted: 습관방 시작했는지 여부.
let isStarted: Bool
let myStauts: String
let memberNum, doneMemberNum: Int?

enum CodingKeys: String, CodingKey {
case roomID = "roomId"
case roomName, leftDay, profileImg, life, isStarted, isDone, memberNum, doneMemberNum
case roomName, leftDay, profileImg, life, isStarted, myStauts, memberNum, doneMemberNum
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ extension HomeVC: UICollectionViewDataSource {
leftDay: habitRoomList[indexPath.item].leftDay ?? 0,
profileImg: habitRoomList[indexPath.item].profileImg,
life: habitRoomList[indexPath.item].life ?? 0,
isDone: habitRoomList[indexPath.item].isDone,
status: habitRoomList[indexPath.item].myStauts,
memberNum: habitRoomList[indexPath.item].memberNum ?? 0,
doneMemberNum: habitRoomList[indexPath.item].doneMemberNum ?? 0)

Expand Down

0 comments on commit 398ba2b

Please sign in to comment.