fix: category initial selection missing issue
This commit is contained in:
parent
d36e60e2a4
commit
c9417a2e17
|
@ -110,7 +110,6 @@ extension MastodonPickServerViewController {
|
|||
.observe(\.bounds, options: [.initial, .new]) { [weak self] navigationActionView, _ in
|
||||
guard let self = self else { return }
|
||||
let inset = navigationActionView.frame.height
|
||||
print("*** \(inset) ***")
|
||||
self.tableView.contentInset.bottom = inset
|
||||
}
|
||||
.store(in: &observations)
|
||||
|
|
|
@ -25,7 +25,11 @@ extension MastodonPickServerViewModel {
|
|||
sectionHeaderSnapshot.appendSections([.main])
|
||||
sectionHeaderSnapshot.appendItems(categoryPickerItems, toSection: .main)
|
||||
serverSectionHeaderView.delegate = pickServerServerSectionTableHeaderViewDelegate
|
||||
serverSectionHeaderView.diffableDataSource?.applySnapshot(sectionHeaderSnapshot, animated: false)
|
||||
serverSectionHeaderView.diffableDataSource?.applySnapshot(sectionHeaderSnapshot, animated: false) { [weak self] in
|
||||
guard let self = self else { return }
|
||||
guard let indexPath = self.serverSectionHeaderView.diffableDataSource?.indexPath(for: .all) else { return }
|
||||
self.serverSectionHeaderView.collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .centeredHorizontally)
|
||||
}
|
||||
|
||||
// set tableView
|
||||
diffableDataSource = PickServerSection.tableViewDiffableDataSource(
|
||||
|
|
Loading…
Reference in New Issue