Embedding UITabBar controller inside UINavigationController - ios

I searched about this case but I couldn't find how to embed tab bar controller inside a navigation controller properly.
To be more specific; I created navigation controller in didFinishLauncinhWithOptions method inside the appdelagete and I am navigating through my view controllers without any problem.
I have a mainViewController with has 3 button and every button is pushing anotherView to navigation controller. In one of the views I am redirected, I want to use a tabbar.
My question is where should I create my tabbar controller in this case and is it allowed to embed tabbar controller inside navigation controller ? If not what should I do because, I really wanna embed my navigation controller from start and have navigation bar thorough out the entire program.
Thanks in Advance.

After struggling some times, I managed to figured out the solution by inserting new view below the tabbar.
This thread really helped me much about the case;
Tab bar controller inside a navigation controller, or sharing a navigation root view
Cheers;

Related

Navigation Bar and navigation items not visible on runtime

I don't understand why SignIn and SignUp navigation Bar and the back buttons are not visible even when embedding both of these views in the navigation controllers.
Is there anything else we have to do in code. All top bars are inferred in this case and I haven't touched the visibility of any.
There is no back button because there is nowhere to go back to. Your sign up and sign in view controllers are the root view controllers of their respective navigation controllers.
There is no visible title because what you are looking at is the navigation item of the tab bar controller, which has no title.
Your architecture posits a navigation controller insider a navigation controller, which is illegal:
nav controller -> tab bar controller -> nav controller
You can't do that.
Also you can't put a tab bar controller inside a navigation controller. A navigation interface inside a tabbed interface is fine (as illustrate in Apple's own docs: https://developer.apple.com/documentation/uikit/uinavigationcontroller). The reverse, a tabbed interface inside a navigation interface, is not.
The simplest solution is to eliminate the first navigation controller completely, as there is no need for it (you are not pushing anything onto it beyond its root view controller).
IN SIMPLE TERMS
Logically, your Tabbar should not be embedded in a UINavigation Controller. Instead, delete the NavigationController and make the Tabbar the root Viewcontroller then embed each UIViewcontroller in a separate Navigation controller

Issue with Navigation Controller logic

I've started to code my first app and got first challenge.
I need menu logic as on the picture below:
So, what is correct way to realize it?
Main menu should be separate View Controller with Segue to Navigation Controller?
or
Navigation controller is initial controller for the app and main menu is a root view for navigation controller? I've tried to do like this but I don't have an idea how to hide top bar from main menu (I don't need it on main menu view)?
Thanks for help.
Case 2. You should make navigation controller an initial controller of the app, and main menu should be a root view controller of the navigation controller.
To hide navigation bar use setNavigationBarHidden(_:animated:)
One of the option is to place this hide/show functionality in viewWillAppear/viewWillDisappear methods of menu view controller as described here iPhone hide Navigation Bar only on first page
In case 1 you will have to implement yourself back functionality and back-forward animation which will require a lot of code.

What type of view controller is used for this app?

Does anybody know what kind of view controller this app uses? I am trying to implement one somewhat like this but can not get the tab bar to appear at the bottom when I use the table view controller. I also can not get the title of the view to appear at the top where it says home.
I would say this is a tab bar controller. The home tab you show may just have a navigation bar placed on top of it as a sub view or it is embedded into a navigation controller.
My image shows a tab bar controller as the root controller and initial controller and the view from the first tab embedded in a navigation controller.
Hope this helps!
The screen you are looking at is a combination of a UItabBarController a UINavigationController and a UITableViewController.

Issue with tab and navigation view controller

I have an iOS app which is structured in this way:
One tab bar controller with 4 navigation controllers. Each navigation controller has its own view controller with a xib file.
The issue, is that ONLY THE FIRST TIME, when I push a new view into one of the navigation controllers, the new view doesn't appear at all. When I switch to another nav controller (touching one of tab bar's options) and then switch back to the first one, it works all the time.
The error I'm getting is when I come back is:
[35731:70b] Unbalanced calls to begin/end appearance transitions for
.
Thanks for helping out.
Make sure you are presenting all your view controllers from the parent / top level view controller (the tab bar controller). I've had this a few times when presenting a view controller from one of the view controllers in the tab bar.
In viewdidload assign your first view controller to load when xib loads. Its the correct way to load first view controller to appear when nib loads.

Modally Presenting a Navigation View Controller in a UITabBarController With a Segmented Control

I've spent the past few days searching on the web for a solution to my problem, however, I can't seem to find a problem similar to mine. I am using a TabBarController and on one of the tabs I have a segmented Control in the navigation bar that I would like to use to switch between view controllers. The problem is that when I present the second view Controller it appears over the tabbarcontroller. Is there anyway to keep the modally presented Navigation controller in the tabbarcontroller?
This is the first controller.
And this is the controller I am trying to present.
well we can't really comment unless we saw some code. But I think your problem may be to do with your view hierarchy. If I was going to build what you are attempting I would do as follows:
UITabbar controller that contains a custom navigation bar controller
The custom nav bar controller would contain the segment controller and have a protocol defined so that a delegate could be alerted when either segment was selected by the user.
The nav bar's root view controller would be a view controller that acted as a UIView container for the two screens you are displaying (friends and circle screens)
This root view controller would be the delegate for the custom nav controller so that it will know when the user selected a segment.
When the user selected a segment the root view controller would then switch between the friends and circles view controllers in the container.
To do the above have a look at the documentation for creating UIViewController Containers and working with delegates
Hope that helps!

Resources