For better understanding I created a new project and broke down my issue.
Before, I had a Storyboard with a Main Menu and from there it is possible to jump to different Viewcontrollers. One of them is embedded in a TabBarController as shown in the image.
To improve the structure, I have refactored the TabBarController to a second storyboard as shown in image2. But now I want to add some NavigationBar Items (Buttons). For each Tab I want to have a Button for some actions. Somehow the NavigationBar is gone now in the new Storyboard.
I have already found some suggestions in different Threads like iOS 8 Swift navigation bar title, buttons not showing in tab based application
From there I tried the code
let navigationBar = navigationController!.navigationBar
navigationBar.tintColor = UIColor.green
let rightButton = UIBarButtonItem(title: "Right Button", style: UIBarButtonItem.Style.plain, target: self, action: nil)
navigationItem.rightBarButtonItem = rightButton
Which gives me a green Back Button, but the rightButton
is not showing.
I have also tried embedding in a new NavigationController
which just results in a double navigation...
Also I tried to add just a NavigationBar
manually, which also results in a double navigation as shown in the image below.
Any ideas how I could solve this?