Skip to content

Commit

Permalink
[Feat] Keyneez#46 - 홈뷰 세그멘티드컨트롤 바뀔 때마다 reload
Browse files Browse the repository at this point in the history
  • Loading branch information
kpk0616 committed Jan 13, 2023
1 parent b214c4f commit e5f81d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Keyneez/Keyneez/Tab/Home/Controllers/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ extension HomeViewController {
@objc private func changeUnderLinePosition() {
animateUnderline()
changeViewControllers()
guard let token = UserSession.shared.accessToken else { return }
repository.getAllContents(token: token) {
[weak self] arr in
guard let self else {return}
self.datasources.append(arr)
DispatchQueue.main.async {
self.VCs.forEach {
$0.contentList = self.datasources[0]
$0.recommendContentCollectionView.reloadData()
}
}
}
}
private func animateUnderline() {
let segmentIndex = segmentControl.selectedSegmentIndex
Expand Down

0 comments on commit e5f81d2

Please sign in to comment.