Issue with Navigation Controller logic - ios

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.

Related

Using UITabBarController with UINavigationController - Swift 3

I am making an app which requires a use of a UITabBarController along with UINavigationController. I have made the following flow in storyboard.
See image
Now the first question is that is this accepted by Apple, as there are too many discussions for the same.
The other matter of concern is that is it possible to eliminate any UINavigationController and still get the same flow of the app? The main thing required is to have the SAME tab bar and navigation bar on all sub tabs of the tabs. One point to be noted is that if I remove the second UINavigationController then my app navigates directly from sub tab to home view controller on clicking back button.
I have been stuck on this since hours now. I am new to iOS app development and have never uploaded any app to the app store. Any help would greatly valued.
EDIT :
I put the second navigation controller as shown in the answers - see this flow, But because I have a navigation controller before the HomeViewController, so I am getting a navigation bar at the top and then some empty space below that(exactly equal to the top navigation bar) and then the page contents on runtime. Any solution to this?
Yes, it is acceptable by Apple.
But View hierarchy is not managed correctly. In your case Tab bar will be the root view controller for 2nd navigation controller.
Also, Tab and sub tab you are pushing will be part of 2nd navigation controller.
That's the reason you are getting back on Home view controller.
It's good practice to keep navigation controller to each Tab to manage it's sub-tab hierarchy.
You could present tab bar controller or setviewcontroller from Home View controller.
First embed tab bar controller as in this image and the embed navigation bar controller as in this image finally this will look like

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.

Embedding UITabBar controller inside UINavigationController

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;

Tab bar disappears when trying to go back from new view

I am very new to Xcode and have encountered an issue with my app. I am trying to create a tab bar app. On one of the tabs I have a button that brings the user to a different ViewController. I want to have it so the user can select a button that would return them to the tab that had the button. I tried to set up an action from the button to the previous view (the tabbed screen), however the tab bar disappears. I hope this is makes sense.
Here is a link to a screenshot...
Easiest way to do this is to place a UINavigationController as the root view controller of the TabBarController. You can do this in storyboard by simply ctrl+dragging from the tabbar controller to the navigation controller and adding it as a relationship.
Here's an example using storyboards:
The next step is to set the third controller (in this case the table view controller) to your player view controller class.
Then, you can use the default back button and animation that comes with the navigation controller. If you prefer to hide the navigation bar at the top of the screen, then you can use your custom back button to call
[self.navigationController popViewControllerAnimated:YES];
You can also choose custom animations / segues, etc. but using a navigation controller to help you navigate screens is probably the simplest approach.

Resources