Skip to content

Commit

Permalink
[Feat] #471 - 콜렉션뷰 레이아웃 갱신 함수 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwogus0128 committed Jan 18, 2025
1 parent e246136 commit fddb7a3
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,22 @@ extension HomeForMemberVC {
output.needToReload
.withUnretained(self)
.sink { owner, _ in
owner.collectionView.reloadData()
owner.updateUI()
}.store(in: cancelBag)
}

private func updateUI() {
updateCollectionViewLayout()
let sectionCount = HomeForMemberSectionLayoutKind.allCases.count
let indexSet = IndexSet(integersIn: 0..<sectionCount)
self.collectionView.reloadSections(indexSet)
}

private func updateCollectionViewLayout() {
let newLayout = createLayout()
self.collectionView.setCollectionViewLayout(newLayout, animated: true)
}

private func setDelegate() {
self.collectionView.delegate = self
self.collectionView.dataSource = self
Expand Down

0 comments on commit fddb7a3

Please sign in to comment.