0

So like i said in the title, my question is :

Is there anyway to remove one tabbaritem without remove view ?

I have readed about UITabBarController , but remove the view not the item.

I need to have 4 childViewControllers in my TabBarControlller but only display 3 in my TabBarItems.

Example:

I have this :

-UITabBarController

  • ViewChildController1
  • ViewChildController2
  • ViewChildController3
  • ViewChildController4

-Tabbar (bottom) from UITabBarController ViewChildItem1 (ViewChildController1)

  • ViewChildItem1 (ViewChildController1)
  • ViewChildItem2 (ViewChildController2)
  • ViewChildItem3 (ViewChildController3)
  • ViewChildItem4 (ViewChildController4) ( remove/hide this one only,but still have the ViewChildController4 in UITabBarController )

I want this without the tabbaritem for the lastview

Ionel
  • 31
  • 3
  • 11
  • Why do you want to have a controller, but have no tab bar item to access it? What is you goal? – rdelmar Feb 17 '15 at 17:12
  • Because I have one button in UITabBar ( TOP ) witch is call that ViewController ( tabBarController setSelectedView:myView ) – Ionel Feb 17 '15 at 17:18

1 Answers1

1

Your question makes no sense. A tab bar controller is a parent view controller that provides access to its children through tab bar items, automatically. That is its purpose. If you don't want this, don't use a tab bar controller.

You can disable a child's tab bar item; you can prevent access to a child; but you cannot have a child be present without being a member of the team, as it were.

It is possible that you need to revise your architecture. If you have a fourth view controller that you want to make appear in some other way, then do so - but then, don't make it a child of the tab bar controller. Perhaps what you want is for this fourth view controller to be a presented view controller, for instance.

matt
  • 515,959
  • 87
  • 875
  • 1,141