Hide a Tab bar Item in Xcode 4 - iphone

I have a tab bar controller with a logginViewController, and I want to hide the tab bar item related to logginViewController and show a different tab bar item with a different ViewController
I'm working using Storyboard in a tab bar based app for iPhone
I've tried this solution but it doesn't work (Xcode don't allow me to use the "hide" option)
Please, any help on how I can do it in Xcode 4 will be great!
Thank you all

I like to suppose, that you subclass your TabBarController.
Via Protocol/Delegate you're able to work with data from your loggingViewController (maybe, a button get's clicked to hide the TabBarItem).
Implement that protocol to your TabBarController and so you're able to receive those protocol-methods to add/hide/delete the Items easily.
Try it out! Or further questions?

Related

Swift - Keeping tab bar displayed through out project

I have seen many other questions very close to this one but couldn't find a solution for this precise case :
I have a tab-bar application, connected to 4 UIViewControllers. I'm trying to connect one of these 4 UIViewController to another UIViewController using a Show action segue and keeping my tab bar displayed.
I'm not embedding the 4 first UIViewControllers in UINavigationController.
Simulated metrics are set to inferred and "Hide bottom bar on push" is unchecked. Segue kind is set to "Show (e.g. Push)".
On my storyboard, the tab bar automatically appears at the bottom of the last created view when I add the segue. When building the project, the tab bar is visible only on the 4 UIViewControllers directly linked to the TabBarController. However, I lose it when the last view is showed.
How do I keep my tab bar displayed on this last view ?
Many thanks for your help !
Found this simple solution :
I have embedded the first ViewController in a Navigation Controller. As I didn't want to show a navigation bar in my header, I simply hid it in Viewdidload :
self.navigationController?.navigationBarHidden = true
Hope this will help someone !

iPhone app: navigate to tab bar scenario

I have an application with a maybe-strange navigation scenario. I'll try to explain:
1) first scene: select an available item from a list
1.1) once selected, you navigate to a tab view allowing you to view/edit the various attributes
2) if the desired item isn't available, you may create a new one (by selecting a "+" bar button) which navigates to an alternate scene
2.1) there may be multiple scenes required to create the item, all scenes are simply pushed on the stack to allow the user to go back, select different options, etc.
2.2) once all scenes have been displayed and all attributes have been collected, the new "item" will be created and saved.
2.3) now, I want to automatically act as though the user selected this item from the beginning, that is, I want to pop all previous views off the stack and navigate directly into the tabs (step 1.1).
Does this make sense? Easy to do? Is there a better way to go about this? I'm using xCode 4.2 with storyboards.
Any guidance would be appreciated.
If you want (+) button on TabBar you should subclass UITabBar: Fo ex. TabBarPlus and set this class in storyboard.
But easier place (+) button on navigation bar.
The max number of displaying tabsart is 5 for iphone and 8 for ipad. If the there > number of tabs the last is "More" tab thet displaing list of other tubs in tableview. I you want displaying more tabs on tabbar then you should subclass UITabBar :)
If you want by back button on naigation bar switching beetwing Views that references with TabBar buttons you must create stack in code and hide backbutton of navigationbar and use castom left button of navigationbar.
The other navigation can be easy done in storyboard

Is is possible to add a 5th tab bar button instead of "More" Button?

I'm working on an iphone application that has exactly 5 tab bar buttons.
I've created a custom tab bar and added 5 buttons to it, each with a separate view controller.
The buttons are showing fine, but the 5th view controller is not loading on 5th tab bar button press. This might be because the 5th button is supposed to be the "More" button. Is their some way to override it?
No the more button wil only show if you have more then 5 viewcontroller in the tabbarcontroller.
You can customize your tab bar to do so.
There're some exist ones, like the one below:
https://github.com/boctor/idev-recipes/tree/master/CustomTabBar
It works Excelent! And you'll see the screenshot that it use five tabs. :)
AS per apple human interface guidelines if you have more than 4 tabs last tab is displayed as more tab and you can not alter it

dynamically change uitabbar items

I am working on app where i need to display a tab bar controller with different viewscontrollers. I mean when i go from one page to other the the items in tab bar should change and when i go back to previous page the items should again become same as they were earlier. Thanks in advance.
I have done it. I just reloaded the tabbar with view controllers and it is working fine.

UITabBarController - more than 20 views

I am using a tab bar (UITabBarController) on my app and I wish to have more than 20 different views to choose from.
If there are more than 5, "More" menu appears. I can access any of my views from "More" menu but I have problems with customizing my TabBar with "Configure" (Edit) navigation bar. I can see only 20 first view icons and I can't scroll the view any direction. Icon with numbers 21 or higher are unavailable in "Configure" (Edit) navigation bar
Is there a way to scroll up and down (or left and right) to be able to customize TabBar with all of my view icons? Is there the other way to customize "Configure" (Edit) navigation bar to get access to all view icons?
Looks like there is no solution for this :( except creating your own UITabBarController.
This is a limitation of the controller provided by Apple, but you can work around this problem as follows:
Catches the action of the edit button and replace it with your own action that aims to display a custom screen that plays differently the sort action.
I have done this way in my applications, when I had the need.