Multiple Navigation controllers/Tab Bar controllers on one storyboard - ios

Ok guys, novice here. I have a screen shot of storyboard I'm working on and I'm running into an issue where I can't name an item on my first tab bar because it points to a second tab bar controller. First I want to ask would this be proper use or should there only be one of these "types" per project. secondly, how the heck can I name the first tab bar item? I would do it normally by clicking on the tab element in the targeted view. Here's the screen shot.

Typically you only have one TabBarController in your project, and it is the root view controller.
And in storyboards, you can name your tabs not on the controller, but on the tabs under the separate views. Try double clicking on the label below your red, blue, yellow, etc views to name your tabs. Or, you can select the area below the view (which should be a TabBarItem) and the use the Attribute Inspector on the right to edit the title.
Attribute Inspector:1

Related

Custom/common toolbar in Swift

I'm quite new to Swift and am working on an app where I'm not sure how to setup the navigation. It works with a tab bar, except that I want the bar to display nomatter what view is being displayed. There are 4 "main" views that the user should always be able to get to. The problem comes when I get into subviews of one of those main views.
I have the tab bar with the 4 icons for the primary views. It's currently displaying the "activity list". When the user clicks on an activity, it will display a list at the next level of detail. However, that view is not one of the primary ones that is represented in the tab bar, so it has no tab bar and no way to transition directly to one of the primary views. You have to back your way out to the Activity list before you can select a different tab.
Say that the main views (represented in the tab bar) are A, B, C, and D. I want to be able to display the same toolbar on all sub-views (e.g. C-1, C-2, etc.) and allow direct transition to any of the other main views, without the user having to manually back out of each sub-view.
What is the "best" way to accomplish this?
1) Should I be creating a custom toolbar object that gets implemented on every view controller?
2) Should it be a combination of tab bar and tool bars?
3) If I have drilled into a stack of views, do I need to pop all of those views individually before I can switch to a different tab?
4) What do I use as my "root" view?
Thanks for any suggestions. I have hunted, but haven't found an example of a scenario quite like this.
I think I figured it out. I needed to embed each "tab" view in a navigation controller.
So...
Tab Bar Controller --> Navigation Controller --> View Controller --> "view stack"
The tab bar now remains at the bottom for every view, and if I touch the tab icon a second time, it goes back to the original tab view controller.

IOS app Nav bar back button

I have looked at all the navigation bars on all the story board scenes of my app, and I have gone through all the view controller m. files and there is no mention anywhere of the navigation bars settings. The mystery is that I have two different pages, one where the back button is in lower case (back), another where it is in title case (Back), and other pages just have the cursor image < or nothing at all. If I click on the storyboard navigation bar area, it highlights in blue, and there nothing obviously there.
I cannot find where this has been defined !!
Any ideas?
In the storyboard check the previous view controller settings (the Controller before Controller with back button).
Select View Controller
Select Navigation Item
Select Attributes inspector tab (triangle icon)
Check Back Button field (there could be invisible symbols like spaces)

iOS: TabController not showing with Navigation Controller

I have an app with the start screen consisting of a table menu main which links to 4 different views, then three options to information pages.
Once on any of the main menu options are chosen, the view is shown with TabBar at the bottom of the main menu options. While the nav bar at the top has a back button leading to the main menu.
I built the storyboard which goes from a table view select to a single page. After that was working and passing data, I embedded the single view into a Tab Bar Controller and added a second page. It seems to be working as I would expect however the Tab Bar is not visible on the screen.
Can please anyone help?
I have added an image of the storyboard below:
Get rid of the navigation controller. There is no deed for it so far. Make the tab bar controller your root view.
If you need a navigation conroller within a certrain tab, or some or all of them, then add navigation controllers to those tabs (to the right in your storyboard).

Remove the morebutton TabbarItem from UItabbarcontroller

I have a tabbar controller which includes six tab bar item. But the problem lies in the more button appears and the whole view get distract due to it. So how do i set all the six controller in the tab bar controller. I dont want to use any customized class.
If i creating a view manually in xib file. Then the tabbar is allowed having six item. Please see the attached images
In above image you can see a favourite tab bar controller which is created manually in xib, so if that is valid. Then how can i create like six tabbaritem in the uitabbarcontroller defined in app delegate. Please reply me back and dont give suggestion for using external classes or customize class.
Five is the most it will display. The standard icons won't fit otherwise. From the documentation:
The tab bar has limited space for displaying your custom items. If you add six or more custom view controllers to a tab bar controller, the tab bar controller displays only the first four items plus the standard More item on the tab bar. Tapping the More item brings up a standard interface for selecting the remaining items.
More than five will show in interface builder because it has no other way of showing you which items are linked to the controller.
So, at risk of a downvote, you'll have to use a custom container that can show more than five options.

How to connect the UITabBarController to 3 different screens?

I just created the UITabBarController and then I embedded the NavigationController into it.
The issue I am having now is that I am not sure how to add tab bar items. Right now I just have one item that goes to the home screen. But what do I do to add tabs to that tabbarcontroller?
I tried control-dragging it to other controllers, but I think that is not the way to go here.
Could someone please point me in the right direction.
Tab bar items are automatically added based on how many view controllers the UITabBarController has.
For example when you call:
self.tabBarController.viewControllers = #[viewController1, viewController2];
2 tab bar items will be created automatically for you.
I assume you're using Storyboards.
If you right click on the Tab Bar view controller connections icon (the round golden icon on the left) or select the connections inspector (on the right) while you've got your navigation controller selected in the storyboard you'll see a "View Controllers" option under "Triggered Segues". Simply drag from that circle to the new view controller you want to be linked in your tab bar controller and voila, new tab bar item.
You can also do all of that from the beginning. If you start a project that is a tabbar project you will automatically get two tabs. If you want more, drag a view controller over from the right pane under objects. Then control click and drag from the root view to the new view controller and select relationship tabbar. You can hook up as many as you want without the code. Hope this helps you out.

Resources