Load more notifications (IOS-272)
This commit is contained in:
parent
fe8e0dfdcd
commit
bd9d19f8b6
|
@ -55,16 +55,6 @@ extension NotificationTimelineViewController {
|
|||
notificationTableViewCellDelegate: 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 }
|
||||
self.viewModel.loadOldestStateMachine.enter(NotificationTimelineViewModel.LoadOldestState.Loading.self)
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
|
||||
// setup refresh control
|
||||
tableView.refreshControl = refreshControl
|
||||
viewModel.didLoadLatest
|
||||
|
@ -306,3 +296,13 @@ extension NotificationTimelineViewController: TableViewControllerNavigateable {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
//MARK: - UIScrollViewDelegate
|
||||
|
||||
extension NotificationTimelineViewController: UIScrollViewDelegate {
|
||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||
ListBatchFetchViewModel.scrollViewdidScrollToEnd(scrollView) {
|
||||
viewModel.loadOldestStateMachine.enter(NotificationTimelineViewModel.LoadOldestState.Loading.self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue