mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-31 17:45:17 +01:00
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,
|
||||
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) {
|
||||
@ -169,3 +158,12 @@ extension UserTimelineViewController: IndicatorInfoProvider {
|
||||
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…
x
Reference in New Issue
Block a user