I put a UISearchBar as a UINavigationController titleView. In iOS 11, I get a different navigation bar height 56. (below iOS 11 is 44)
let searchBar = UISearchBar.init(frame: CGRect.init(origin: .zero, size: CGSize.init(width: UIScreen.main.bounds.width, height: (navigationController?.navigationBar.frame.height)!)))
navigationItem.titleView = searchBar
I try to put UIView, UISegmentControl into titleView, but only searchBar get height 56.
I can set searchBar.heightAnchor.constraint(equalToConstant: 44).isActive to make navigation bar back to height 44, but I believe it's not a elegant solution
Is there any reference about this change? Thanks!