Search code examples
iosswiftuinavigationcontrolleruinavigationbar

Navigation bar specific to each view controller like Apple Music


How do I have the navigation bar specific to each view controller? On the right side, the navigation bar stays with the view controller, and the left view controller has its own navigation controller. Should I just make a custom transition? Any ideas ?

enter image description here


Solution

  • Add this code in your first viewController

    override func viewDidLoad() {
            super.viewDidLoad()
            navigationController?.setNavigationBarHidden(false, animated: false)
    }
    

    Then add navigationBar in your viewcontrollers from storyboad. Or you can add one in viewDidLoad programmatically