fix: pick server table margin not works issue
This commit is contained in:
parent
35d572660b
commit
66d23432c1
|
@ -92,7 +92,7 @@ extension MastodonPickServerViewController {
|
|||
tableView.topAnchor.constraint(equalTo: view.topAnchor),
|
||||
tableView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
||||
tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
||||
tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
||||
tableView.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor),
|
||||
])
|
||||
|
||||
navigationActionView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
@ -107,10 +107,10 @@ extension MastodonPickServerViewController {
|
|||
])
|
||||
|
||||
navigationActionView
|
||||
.observe(\.bounds, options: [.initial, .new]) { [weak self] navigationActionView, _ in
|
||||
.observe(\.bounds, options: [.initial, .new]) { [weak self] _, _ in
|
||||
guard let self = self else { return }
|
||||
let inset = navigationActionView.frame.height
|
||||
self.tableView.contentInset.bottom = inset
|
||||
let inset = self.navigationActionView.frame.height
|
||||
self.viewModel.additionalTableViewInsets.bottom = inset
|
||||
}
|
||||
.store(in: &observations)
|
||||
|
||||
|
@ -149,7 +149,8 @@ extension MastodonPickServerViewController {
|
|||
KeyboardResponderService
|
||||
.configure(
|
||||
scrollView: tableView,
|
||||
layoutNeedsUpdate: viewModel.viewDidAppear.eraseToAnyPublisher()
|
||||
layoutNeedsUpdate: viewModel.viewDidAppear.eraseToAnyPublisher(),
|
||||
additionalSafeAreaInsets: viewModel.$additionalTableViewInsets.eraseToAnyPublisher()
|
||||
)
|
||||
.store(in: &disposeBag)
|
||||
|
||||
|
|
|
@ -46,7 +46,8 @@ class MastodonPickServerViewModel: NSObject {
|
|||
let unindexedServers = CurrentValueSubject<[Mastodon.Entity.Server]?, Never>([]) // set nil when loading
|
||||
let viewWillAppear = PassthroughSubject<Void, Never>()
|
||||
let viewDidAppear = CurrentValueSubject<Void, Never>(Void())
|
||||
|
||||
@Published var additionalTableViewInsets: UIEdgeInsets = .zero
|
||||
|
||||
// output
|
||||
var diffableDataSource: UITableViewDiffableDataSource<PickServerSection, PickServerItem>?
|
||||
private(set) lazy var loadIndexedServerStateMachine: GKStateMachine = {
|
||||
|
|
Loading…
Reference in New Issue