Skip to content

Commit

Permalink
feat : show count of menus in section
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonPk committed Apr 23, 2021
1 parent c78a8e6 commit a22cadb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class CollectionViewDataSource: NSObject, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: SectionHeaderView.identifier, for: indexPath) as! SectionHeaderView
headerView.sectionTitleLabel.text = allDishes[indexPath.section].category.getSectionTitle()
headerView.countOfMenus = CollectionViewConstant.numberOfItems
headerView.countOfMenus = allDishes[indexPath.section].dishes.count

return headerView
}
}
3 changes: 1 addition & 2 deletions iOS/BanchanCode/BanchanCode/Views/SectionHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class SectionHeaderView: UICollectionReusableView {
}

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {

//총 몇개인지를 어떻게 받아올까?

Toast(text: "\(countOfMenus)개 상품이 등록되어 있습니다").show()
}
}

0 comments on commit a22cadb

Please sign in to comment.