Load more entries from user timeline (IOS-272)
This commit is contained in:
parent
af650edbb0
commit
622a2fa5c9
|
@ -54,17 +54,6 @@ extension UserTimelineViewController {
|
||||||
tableView: tableView,
|
tableView: tableView,
|
||||||
statusTableViewCellDelegate: self
|
statusTableViewCellDelegate: self
|
||||||
)
|
)
|
||||||
|
|
||||||
// setup batch fetch
|
|
||||||
viewModel.listBatchFetchViewModel.setup(scrollView: tableView)
|
|
||||||
viewModel.listBatchFetchViewModel.shouldFetch
|
|
||||||
.receive(on: DispatchQueue.main)
|
|
||||||
.sink { [weak self] _ in
|
|
||||||
guard let self = self else { return }
|
|
||||||
guard self.view.window != nil else { return }
|
|
||||||
self.viewModel.stateMachine.enter(UserTimelineViewModel.State.Loading.self)
|
|
||||||
}
|
|
||||||
.store(in: &disposeBag)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
|
@ -169,3 +158,12 @@ extension UserTimelineViewController: IndicatorInfoProvider {
|
||||||
return IndicatorInfo(title: viewModel.title)
|
return IndicatorInfo(title: viewModel.title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - UIScrollViewDelegate
|
||||||
|
extension UserTimelineViewController: UIScrollViewDelegate {
|
||||||
|
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
||||||
|
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
||||||
|
viewModel.stateMachine.enter(UserTimelineViewModel.State.Loading.self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue