Hiding tab bar items on xcode - ios

So i have a tab bar controller linked to 4 different view controllers.
My first viewcontroller (First page that pops up during simulation) is my login page. I just want to hide the tab bar items before logging in and after the right login details have been entered re-enable the tab bar items to be accessible.
I have read other related questions in this site however i can't seem to find a simple solution. I thought the coding would be as easy as hiding images or labels.
any help will be great!

Try:
//To hide the tab bar
self.tabBar.hidden = YES;
//To disable tab bar item in tab bar controller
[[[[self.tabBarController tabBar]items]objectAtIndex:1]setEnabled:FALSE];

Related

Tabs on Tab Bar Controller iOS doesn't work?

I am trying to make a segue from the tabs on the Tab Bar Controller. But I cannot attach them to anything! What am I doing wrong?
If I click on the tab bars (I have 2), none of them updated the current view displayed.
Also, how can I customize their widths? I want each to take up 50% of the bar; unlike here:

How to link a tab bar with its view controllers in a storyboard?

If you've only ever used a tab bar controller and not a tab bar on its own, then don't close this or mark it as a duplicate based upon your presumptions and assumptions.
I've added a tab bar to a view controller and now want to connect the tab bar with the view controllers that will be selected via it.
I've done this sort of thing many, many times before using a tab bar controller and assumed it would be just as straightforward as but when a using just a tab bar but no - I just can't find or see any way of doing it. Tried adding tab bar items to the view controller and tried dragging between these and the tab bar, and between the tab bar and the tab bar items and to the view controllers. Millions of combinations and can't get it to work.
Googling or searching for past questions on this isn't as straightforward as you'd think - because the search results all come back involving the use of a tab bar controller, I can't see anything for just a tab bar which is part of a regular view controller.
I think, this is not possible using a storyboard. You should do this in code.
Or maybe hideBottomBarWhenPushed is what you are searching for.

Disable "Edit" Button that appear in more selection of tab bar ios

I am new in iOS. I use Seven Tab bar item in my tab bar controller story board and when run app then it shows more buttons when I click on it it is also show edit button. I do not want that edit button. How can this be done?
This is my code:
[[[tabBarController moreNavigationController] visibleViewController] setTitle:#""];
But it does not work.
You had to say that none of your view controllers is customizable. Then the edit button disappears. Please look up the docs.
tabBarController.customizableViewControllers = #[];
Docs: "This property controls which items in the tab bar can be rearranged by the user. When the user taps the More item on the tab bar view, a custom interface appears displaying any items that did not fit on the main tab bar. This interface also contains an Edit button that allows the user to rearrange the items. Only the items whose associated view controllers are in this array can be rearranged from this interface. If the array is empty or the value of this property is nil, the tab bar does not allow any items to be rearranged."
On Swift: You can also have those items you want to be editable in the array:
tabBarController.customizableViewControllers = []
Ensure that if you have a navigation controller for the tabbar controller that it is not translucent because the more navigation bar will be behind the main navigation bar. This sometimes shows an empty space above the more tableview.
You can completely hide the more navigation controller if you do not need it, since tapping the more tab pops the top view controller.
tabBarController.moreNavigationController.navigationBar.isHidden = true

iOS tab bar issue

In my app i'v UITabbarController as rootviewController with 3 tabs on it, each tab has its own UINavigationController.On the first tab i'v attached a UIViewController that hides tab bar and navigation bar, by click on a button user can go to next screen that will show tab bar as well as navigation bar.Now the problem is when i click on first tab on this view controller (which is already selected by default) it takes me on previous view controller and i want it should stay on the same screen.How to achieve this?
Edit: I dont want to disable bar item at index 0 as this turns it into UIControlStateDisabled which make it different looks from others.
Is there any way to set image for UIControlStateDisabled for tab bar item?
Any help or suggestion would be appreciated.
Try this may be helpfull...
[[[[self.tabBarController tabBar]items]objectAtIndex:1]setEnabled:FALSE];
set "objectAtIndex" that you want..

how can i hide a tab on the tab bar in iphone

i'm working on an iphone project and i have to show a login view and after log in i have to show a tab bar, all the tabs show different views and all the views have controls that link to other views. so i was wondering what can i do about it, first i was thinking to work with a navigation controller but while reading some posts they suggest not to work with a navigation that includes a tab bar controller. so, i think i can work with a tab bar controller and the first tab should be the login tab but i need to hide the tab bar from the view while logging in and after that i can show the tab bar with the other tabs. i don't know if it's possible. that's why i need your help. thanks in advance
You only need to set the property "hidesBottomBarWhenPushed" to YES. like..
mTSProjVC.hidesBottomBarWhenPushed =YES;

Resources