Skip to content

Commit 28b7075

Browse files
committed
✨ :: (#416) 홈 화면 복귀 시 최근 본 기업 CollectionView 첫 번째 셀로 스크롤 초기화
1 parent 4fd7514 commit 28b7075

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Projects/Presentation/Sources/Home/HomeViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ public final class HomeViewController: BaseReactorViewController<HomeReactor> {
180180
.disposed(by: disposeBag)
181181

182182
viewWillAppearPublisher.asObservable()
183+
.do(onNext: { [weak self] _ in
184+
self?.recentCompanyCollectionView.setContentOffset(.zero, animated: false)
185+
})
183186
.map { _ in HomeReactor.Action.viewWillAppear }
184187
.bind(to: reactor.action)
185188
.disposed(by: disposeBag)
@@ -252,6 +255,7 @@ public final class HomeViewController: BaseReactorViewController<HomeReactor> {
252255

253256
reactor.state.map { $0.recentCompanyList }
254257
.distinctUntilChanged()
258+
.observe(on: MainScheduler.instance)
255259
.bind(to: recentCompanyCollectionView.rx.items(
256260
cellIdentifier: RecentCompanyCollectionViewCell.identifier,
257261
cellType: RecentCompanyCollectionViewCell.self

0 commit comments

Comments
 (0)