Is there a way to change (namely, decrease) the height of a UINavigationBar in a UINavigationController? I have tried the following to no avail:
extension UINavigationBar {
override open func sizeThatFits(_ size: CGSize) -> CGSize {
return CGSize(width: UIScreen.main.bounds.size.width, height: 10)
}
}
class CustomNavigationController : UINavigationController {
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
navigationBar.frame.size.height = 10
}
}
Thanks in advance!