iOS 11 black bar appears on navigation bar when pushing view controller iOS 11 black bar appears on navigation bar when pushing view controller swift swift

iOS 11 black bar appears on navigation bar when pushing view controller


The problem is that in case of double velocity that your view size is smaller then the navigation controller view size.

So when you scrolling trough the view's frame is changing during changing of content offset and it's doubles velocity as well.
That would explain that behaviour. Please try following to fix the problem.

extendedLayoutIncludesOpaqueBars = true

You should add this line at your UIViewController, UITableViewController or UICollectionViewController


You can add a constraint of height 44 to the search bar for iOS 11.

if #available(iOS 11.0, *) {    searchBar.heightAnchor.constraint(equalToConstant: 44).isActive = true}


Had the same issue and fixed it by removing the following piece of code from the parent controller during viewWillDisappear

self.navigationController?.setNavigationBarHidden(true, animated: animated)