I have a tab bar item on navigation controller connected with tab bar controller and i want to delete the title in swift
Tab Bar Controller > Navigation Controller > View Controller
Tab Bar Item
Flow of the program
The application start with the tab bar controller with five tabs each one of these tabs are working fine i mean as hiding the title under the tab bar item but the tab in the image only have the problem of not been hidden and for that the application is also working on this tab okay if the user is logged out and the Viewcontroller in the image is showing but if the user is sign in the title on the tab bar item is showing so if there is away that i can hide the title programmatically
If you don't want that behavior, you should set hidesBottomBarWhenPushed to true where applicable. This will hide the tab bar along with any toolbars you had showing, but only when a view controller is pushed onto the navigation stack. This allows you to show the tab bar at first, then hide it when you need more room.
To add a tab, first drag a new View Controller object to the storybard. Next control-drag from the tab bar controller to new view controller and select view controllers under Relationship Segue . Your tab bar controller will update with a new tab.
To add the new View Controller to the Tab Bar Controller, right-click the Tab Bar Controller and drag it to the new View Controller. Select Relationship Segue. Now, the Tab Bar Controller has the third item and Relationship “view controllers” to “View Controller”.
The user of your app can switch between view controllers by tapping one of the tabs in the tab bar at the bottom of the screen. A tab bar is often used to switch between different, but comparable view controllers.
As others have suggested, you can either go to Interface Builder and erase the Title on the Bar Item or you can do it programatically.
This is enough as long as you don't set the title property for the UIViewController that your tab links to. If you want to set a title for your view controller and avoid it showing up as the bar item title, use navigationItem.title = "My Title"
instead of title = "My Title"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With