Skip to content

Commit

Permalink
Merge pull request #119 from boostcampwm-2022/bugfix_home
Browse files Browse the repository at this point in the history
[홈] 캡슐 순서를 랜덤에서 고정 순서로 변경
  • Loading branch information
solbat authored Dec 13, 2022
2 parents b894891 + d61db64 commit 044a5ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ import UIKit
import CoreLocation

enum CapsuleType: CaseIterable {
case closedLongest
case closedShortest
case memoryOldest
case memoryNewest
case nearest
case farthest
case closedShortest
case closedLongest
case memoryNewest
case memoryOldest
case leastOpened
case mostOpened

var title: String {
switch self {
case .closedLongest:
return "밀봉한지 가장 오래된 캡슐"
case .closedShortest:
return "가장 최근에 생성한 캡슐"
case .memoryOldest:
return "가장 오래된 추억이 담긴 캡슐"
case .memoryNewest:
return "가장 최근 추억이 담긴 캡슐"
case .nearest:
return "가장 가까운 위치의 캡슐"
case .farthest:
return "가장 먼 위치의 캡슐"
case .closedShortest:
return "가장 최근에 생성한 캡슐"
case .closedLongest:
return "가장 오래전 생성한 캡슐"
case .memoryNewest:
return "가장 최근 추억이 담긴 캡슐"
case .memoryOldest:
return "가장 오랜 추억이 담긴 캡슐"
case .leastOpened:
return "열어본 횟수가 가장 적은 캡슐"
case .mostOpened:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ final class HomeViewController: UIViewController, BaseViewController {

override func viewDidLoad() {
super.viewDidLoad()
configure()
configureView()
bind()

Expand All @@ -37,9 +36,6 @@ final class HomeViewController: UIViewController, BaseViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
viewModel?.input.viewWillAppear.onNext(())
}

private func configure() {
AppDataManager.shared.fetchCapsules()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class HomeViewModel: BaseViewModel, CapsuleCellNeedable {
return
}
owner.output.featuredCapsuleCellItems.accept(
CapsuleType.allCases.shuffled()
CapsuleType.allCases
.map { owner.getHomeCapsuleCellItem(capsules: capsuleList, type: $0) }
.compactMap({ $0 })
)
Expand Down

0 comments on commit 044a5ac

Please sign in to comment.