i am very new to all the swift stuff and i hope somebody can help me with this problem
I have set up the following
- Tabbar Controler with 1 Navigationcontroller
So if i start the application everything is fine and the view controller with the "Button" is loaded in tab 1
Now i want to navigate within tab1 to another view controller with a "label"
Thats what i did :
Connected the button to the new view controller with the label as "Show seque"
If i start the application and click on the button then the new view controller with the label slides and and shows the back button
-- > So everything is OK here in my eyes ..it slides only "once"
But if i add a UIBarButtonItem in the View Controller on the top left programatically and want to navigate programatically to the view controller with the label it is loading twice. I am using the following code:
@objc func settingsTapped() {
let new = storyboard?.instantiateViewController(withIdentifier: "new") as! NewViewController
self.navigationController?.pushViewController(new, animated: true)
}
The problem here is that the view controller is loaded always twice. It slides and slides again so i have to click two times to go back to the main view controller
Can anybody help me here please ?
I do not understand why this happens because if i click on the button with the "Show seque only" then it slides only once as expected.