Home > Software design >  Handling the Tab Bar Controller View buttons and code
Handling the Tab Bar Controller View buttons and code

Time:11-16

I'm developing an app for my thesis and I'm a little bit confused on what I should do here/where to write the code that I have and that worked before modifying these views.

Basically after the login process I only had a view (I was still testing at that time), now I made a Tab Bar Controller and 3 view under it. Problem is, the logout button I made for them is no longer working cause I don't know where to write the code for the Tab Bar Controller View...

For a normal view you just connect the swift file and it's done and dusted, you write everything you want in there and watch it work with the assistant view, but I'm not familiar with the Tab Bar Controller View...

In the photo I provided there is a logout button that is clicked, so you can see it better.

enter image description here

Note that depending on your view hierarchy, you should manage the navigation, that means if your UITabBarController is a child for UINavigationController, you can access the navigation controller from the tabbar reference: tabbarController?.navigationController

  • Related