0

I have a main view that I'm using swiftUI for and I want to hide the navbar for. I've used

.navigationBarTitle(Text("Home"), displayMode: .inline)
.navigationBarHidden(true)

to hide the navbar on this main page. My problem is that I use a navigation link to go to a UIKit view that I've created and I can't get the navbar to show up on this page no matter what I do. I've tried setting navigationBarHidden(false) under the navLink and that doesn't work, nor does

    override func viewDidAppear(_ animated: Bool) {
        navigationController?.setNavigationBarHidden(false, animated: true)
        super.viewDidAppear(animated)
    }

in my UIKit view. I need to be able to have the back button displayed at the top for subsequent pages. Does anyone have any ideas?

0___0
  • 1
  • If your UIKit wrapped into UIViewRepresentable as I hope, then the solution from [SwiftUI show/hide title issues with NavigationBar](https://stackoverflow.com/a/60996978/12299030) should be helpful – Asperi Jul 01 '20 at 18:38
  • Just what I was looking for, thanks! – 0___0 Jul 02 '20 at 19:32

0 Answers0