Skip to content

Commit

Permalink
refactor: Mod SectionList Order
Browse files Browse the repository at this point in the history
섹션이 순서대로 나오지 않는 버그 수정
  • Loading branch information
youngminshim-de committed Apr 23, 2021
1 parent 51bb2ee commit 8771f44
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension BanchanListViewController {

guard let view = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: BanchanCustomCellHeader.identifier, for: indexPath) as? BanchanCustomCellHeader else { return nil }

view.configure(title: section.rawValue, count: self.viewModel.count(section: section))
view.configure(title: section.description(), count: self.viewModel.count(section: section))
return view

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ import Foundation
import Combine

class BanchanListViewModel {
enum Section: String, CaseIterable {
case soup = "정성이 담긴 뜨끈뜨끈 국물요리"
case side = "식탁을 풍성하게 하는 정갈한 밑반찬"
case main = "모두가 좋아하는 든든한 메인요리"
enum Section: Int, CaseIterable{
case main = 0
case soup, side

func description() -> String {
switch self {
case .main:
return "모두가 좋아하는 든든한 메인요리"
case .soup:
return "정성이 담긴 뜨끈뜨끈 국물요리"
case .side:
return "식탁을 풍성하게 하는 정갈한 밑반찬"
}
}
}

@Published var menu: Dictionary<Section, [Banchan]>
Expand Down

0 comments on commit 8771f44

Please sign in to comment.