We are currently having an issue with navigation bar sizing when using modal presentation in iOS 13.
In most cases this works fine as can be seen in this screenshot:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if #available(iOS 13.0, *) {
navigationController?.navigationBar.setNeedsLayout()
}
}
We found this work around here and it worked for us.
Like Rod's answer, but I found it only works if I put setNeetsLayout() in next main thread runLoop:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Workaround for iOS 13 modal gap below navigationbar
if #available(iOS 13.0, *) {
DispatchQueue.main.async {
self.navigationController?.navigationBar.setNeedsLayout()
}
}
}