In my app I have a UISearchBar
under UINavigationBar
so it is always visible to user. In that case I had to set contentInset
with extr
self.rx.viewDidAppearOnce
.flatMapLatest { _ in RxKeyboard.instance.isHidden }
.bind(onNext: { [unowned self] isHidden in
guard !isHidden else { return }
self.tableView.beginUpdates()
self.tableView.contentInsetAdjustmentBehavior = .automatic
self.tableView.endUpdates()
})
.disposed(by: self.disposeBag)
This is how it can be fixed easily through Storyboard (iOS 11 and Xcode 9.1):
Select Table View > Size Inspector > Content Insets: Never