UITabBarController add viewcontroller without tab bar item - ios

I am creating an iOS application where I need to add a SideMenu and a UITabBarController, SideMenu and UITabBarController there purpose is to let the users navigates between different ViewControllers, I have 3 tab bar items in UITabBarController and in the SideMenu I have 5 items, when the user click on an item in the side menu I have to show the corresponding view controller
Question:
It's possible to add a ViewController without a TabBarItem to the UITabBarController, when the user click on the side menu item, I trigger the UITabBarController to select the corresponding view controller, or its not possible in UITabBarController I need to find another solution, if so please advice which solution is better.
In the picture above, These are my viewcontrollers but I need to hide the tab bar item for the last view controller and keep the UITabBarViewController behave normally when I programmatically select the last view controller from the side menu

If the ViewController of the side menu is different than the TabBar. You can PUSH the view directly in the controller that is selected in the tabbar in that moment.

Related

Swift: how to make tab view controller button not show?

Ok, I have all my view controllers managed by a tab bar controller, and obviously when you connect in the storyboard the relationship between the controller and the Vcs as "view controller" a button appears on the tab bar. These are then accessible via the tab bar controller.
My problem is I need to have one VC be the in view controller array but NOT BE SHOWN IN A BUTTON on the tab bar. It should not be accessible to the user, but I need to be able to switch to that VC in code with selectedIndex
I do not know how to do this. I have tried disabling the button and doing
self.tabBar.items?[3].accessibilityElementsHidden = true
But the button is still there on the tab bar. How can I have the VC in the array of the tab bar controller but not shown in a button?
This is not possible using the UITabBarController as is.
Not 100% sure on why you need to have a VC in that array but never visible on the bar, consider subclassing UITabBarController if thats the case.
Changes to the viewControllers or items property of a UITabBarController will encourage iOS to reload the Component and hence why you are seeing the VC in the TabBar.

Add Tab Bar to Navigation Controller

I want to add a tab bar with three options (Home) the first view, (Incidences) with the second view, and (Info) with the third view, in the first view I have 2 buttons that shows the second and the third view.
What I have to do to add tab bar with these 3 tabs, always visible in the App?
I have this structure now:
New project -> Tabbed Application.
Replace the First and Second Views with your viewControllers. There will be no need for your left hand side view as the tabs will be your buttons
Each UIViewController in UITabBarController could be embedded in an UINavigationController at your convenience, that way you'll be able to use all of the features that you need.
Apple guideline for Tabbar: Tab Bar Controllers
Basically, you need to select the View Controller of (associated with) Tab Controller ▶ click on Editor menu item ▶ select Embed in and click on Navigation Controller
For correct flow of navigation using tabbar you need to bind tabbar
controller with View Controller first and then embed navigation
controller to tabbar. Similar way you can also embed navigation
controller to tabbar controller, but its not the correct flow.

Integrating ECSLidingViewController for my UITaBBarController app

Am stuck up in implementing facebook slide menu kind of view using ECSlidingViewController source code [https://github.com/edgecase/ECSlidingViewController] for my requirement.
My need is: I have a loginScreen and then next is a UITabBarController with 5 tabs. When I click on the 2nd tab, I need this 2nd tab VC to act as a central VC with a UIBarButtonItem on the RIGHT side of Nav Bar. When I click on the UIBarButtonItem I need facebook kind of sliding view to appear. Please let me know how do I integrate this. This should be done in Storyboards.
Your second tab can be a reference to ECSlidingViewController. Your view controller relationships would look something like this:
UITabBarController's second tab -> ECSlidingViewController
ECSlidingViewController's topViewController -> UINavigationController
ECSlidingViewController's underRightViewController -> a view controller your users will see when the top view is anchored to the left
UINavigationController's rootViewController -> some view controller your users will see as the second tab
You can setup a right bar button item on the navigation controller to anchor the top view to the left.

How to create a UIView with NavigationBar and TabBar

I would like to introduce in my app a View that will contains both navigation bar and a tab bar at the bottom. View contains a Table View with multiple entries and once user tap on a cell a push segue takes him to another view with details regarding the cell he has previously tapped. If he decides, user can go back to parent view by tapping on 'Back' button of the navigation bar on top. In addition to this, I would like my view to have a tab bar at the bottom with extra tools for the user. So, if he decides to check the 'Creator' of the app, he can by simply tap on 'Creator' TabBarItem at the bottom.
I would like to ask you what is the best way to achieve the above. I have already tried to use UITabBarController combined with UINavigationController. Didn't achieve what I was looking for because I would like the view with the table on it to be independent from the TabBarController and NOT a part of it (by part I mean by accessible through tabs).
Do you believe a UINavigationController view with UITabBarView would be a better choice?
UPDATE
What I mean by, "independent from the TabBarController and NOT a part of it":
Once the app loaded, I would like to see my main view (with table) contains Navigation Bar on top and Tab Bar at the bottom. However, I don't want to see the first tab of the Tab Bar selected because my main view will not be accessible through tabs of the Tab Bar but through Navigation Bar. If, for example, I am in Main view and tap on 1st tap, I would like to move to another view that will contains some other info.
Option 1:-
Create a tab bar Controller and on that TabbarController assign your navigation Views.
say nav1 with tab1 , nav2 with tab2...
Option 2:-
Create a Navigation View Controller and than add the tabbarcontroller on that navigationView Controller by using addSubView.
So when the user clicks on a row in a table u will go to a different View which doesn't have the TabbarController and when the user comes back he will again see the TabbarController.
This is what I will do:
First I will subclass UITabbarController and create for example ParentTabBarController. This controller will contain all the tabs necessary and what they will do if they are clicked so on.
Next for each viewcontroller I create, I will subclass from this ParentTabBarController so that the tabs are already in. You can add additional functionality or override it depending on your situation.
In your appdelegate pass in a navigation controller and every time push and dismiss the viewcontrollers you created in second step.
Hope this helps..

How to go from a single view to a tab bar view

need some help here
My problem is, my app starts with a single view, it shows a menu made with buttons that takes me to different places, one of this places is another kind of menu, but this menu is a tab bar menu, so the thing is, I made a new file with its .xib, I added the tab bar controller, and i Linked all the sections of my tabs with its viewcontrollers...
this means that I have my first menu ready, I have my view controllers ready, I have my menu on the tab bar ready....
so my problem is...
how can I go from my single view (the first view that I see and that doesnt include a tab bar), to the new screen with tab bar controller in it after pressing a button???
help me please
Note: I'm using XCode 4.2 and I'm not working with storyboards (requirements of the app)
You have three options to show your viewController content :
1.using presentModalViewController:
2.add the viewController view as a subView to the current viewController. in your case : [singleViewController.view addSubView:tabBarViewController.view];
3.or if your simple ViewController is the navigation root viewController you can push other viewControllers to its navigation stack. (as #roronoa zorro described).
You might have added all the next viewControllers on the taBarController so if you have want to tabbar on to next screen you simplr have to push the tabbarcontroller on the navigationcontroller.
[self.navigationController pushViewController:TabBarControllerObj];

Resources