feat: make content inset take effect for page navigation
This commit is contained in:
parent
e006ea92c0
commit
d8af11a9bc
|
@ -64,11 +64,12 @@ extension SearchResultViewController {
|
|||
KeyboardResponderService.shared.state,
|
||||
KeyboardResponderService.shared.endFrame
|
||||
)
|
||||
Publishers.CombineLatest(
|
||||
Publishers.CombineLatest3(
|
||||
keyboardEventPublishers,
|
||||
viewModel.viewDidAppear
|
||||
viewModel.viewDidAppear,
|
||||
viewModel.didDataSourceUpdate
|
||||
)
|
||||
.sink(receiveValue: { [weak self] keyboardEvents, _ in
|
||||
.sink(receiveValue: { [weak self] keyboardEvents, _, _ in
|
||||
guard let self = self else { return }
|
||||
let (isShow, state, endFrame) = keyboardEvents
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ final class SearchResultViewModel {
|
|||
}()
|
||||
let items = CurrentValueSubject<[SearchResultItem], Never>([])
|
||||
var diffableDataSource: UITableViewDiffableDataSource<SearchResultSection, SearchResultItem>!
|
||||
let didDataSourceUpdate = PassthroughSubject<Void, Never>()
|
||||
|
||||
init(context: AppContext, searchScope: SearchDetailViewModel.SearchScope) {
|
||||
self.context = context
|
||||
|
@ -93,7 +94,10 @@ final class SearchResultViewModel {
|
|||
}
|
||||
|
||||
diffableDataSource.defaultRowAnimation = .fade
|
||||
diffableDataSource.apply(snapshot, animatingDifferences: true)
|
||||
diffableDataSource.apply(snapshot, animatingDifferences: true) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
self.didDataSourceUpdate.send()
|
||||
}
|
||||
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
|
|
Loading…
Reference in New Issue