-2

So I just updated to iOS 15 and Xcode 13, and when I present a view controller, the top nav bar is invisible, however, the top nav title and buttons are still there. How do I fix this?

enter image description here

Im storyboard for the segue:

enter image description here

Vandal
  • 708
  • 1
  • 8
  • 21

2 Answers2

1

If you are using Xcode 13 this will help:

private func setupAppearance() {
    let navBarAppearance = UINavigationBarAppearance()
    navBarAppearance.configureWithOpaqueBackground()
    UINavigationBar.appearance().standardAppearance = navBarAppearance
    UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance

    if #available(iOS 15.0, *) {
        let tabBarAppearance = UITabBarAppearance()
        tabBarAppearance.configureWithOpaqueBackground()
        UITabBar.appearance().standardAppearance = tabBarAppearance
        UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
    }
}
Murlakatam
  • 2,729
  • 2
  • 26
  • 20
0

This is a change Apple implemented and occurs on iOS 15 for an app compiled with Xcode 13. They have changed the default nav bar appearance to transparent rather then translucent. You can change it back to translucent with UINavigationBarAppearance and its .configureWithDefaultBackground() method.

There's a good blog post on this at: iOS 15 Nav bar changes

shim
  • 9,289
  • 12
  • 69
  • 108
flanker
  • 3,840
  • 1
  • 12
  • 20