I am using a Navigation Controller in Xcode8, the navigation bar doesn't appear on the following View Controller on the Dashboard. They will appear on the simulator and on the ViewController topDown tree, but nothing on the view of the dashboard.
Navigation Controller Screenshot
Its'a strange problem, It always happen to me too. You can change your segue type to deprecated Push to see nav bar, after that you can change again.
When you connect your navigation controller to the view controller it happens, because it creates segue type to Show. When you change the segue type to Push segue, you can see the Nav Bar on your View Controller.
Just click the segue, you should see the segue options on the right like the picture.
The problem was the segue before the Navigation Controller. When I delete it, all the Navigation Bar come back. Don't know why, but if the problem happen, you just have to delete this segue and then with Ctrl+Z, the segue come back and the nav bar stay
Related
I tried to build a simple segue. Therefor I embedded a Navigation Controller and set it as the initial View Controller. I then created the segue (kind: show) to a different ViewController.
Storyboard
Even the storyboard looks right and I can run the app without any Errors or Warnings.
But when I open the app in the simulator and press on the button to switch screens the new view pops up like a modal presentation.
Simulator
None of this is done programmatically. To solve this issue I tried different segue kinds after that I rebuild the Navigation Controller and segue entirely but it changed nothing.
I just created two view controllers, embedded a nav controller and then connected a button in the first view controller to the second. In the simulator, pressing the button showed the second view controller with a nav bar on top. Try deleting the current segue and nav controller, and then embed in the nav controller and create the segue again.
Storyboard
First page
Second page
Can anyone tell me why, in the storyboard here below, when I arrive from the first tab the toolbar is visible, but when I arrive from the second tab is not visible anymore.
The first tab has a navigation controller as the root controller - the second does not.
You can select SearchVC in your storyboard and then use the Editor - Embed In - Navigation Controller menu option to add a navigation controller. That might not be how you want your UI. But that would achieve what you want visually ...
Update:
Based on discussions with the OP, the issue was that SearchVC was adding EditorVC as a child view controller and then EditorVC in turn would add ReadVC to the navigation stack.
EditorVC, as it appears above, is embedded within a UINavigationController. I suggested that OP remove that UINavigationController instance and then push EditorVC on to SearchVC's navigation controller and then later when ReadVC is displayed from EditorVC, again push ReadVC on to the existing navigation controller. I believe this should resolve the issues that OP was seeing.
I looked at the following two resources: Tab bar disappears after segue and My Tab bar controller disappears after a push segue. However, both of them are in Objective-C and they don't seem to address the issue that I am having.
Here is my Main Story Board:
Zoomed in is:
Now, let's call the view controller that has Sign Up and Log In VC1 and the one with the Facebook button, VC2. When I go to VC1 from the Tab Bar Controller, everything is good. I have the tab bar on the bottom of my VC1. And I tap Sign Up and the tab bar is gone. Which I want. And when I go back to VC1 (there is a navigation bar on VC2 with the button cancel that I programmatically added in, and when clicked on, takes me to VC1), the tab bar is gone. But I want the tab bar there.
Some people have suggested me to use a navigation controller. But I do not want to use it because I don't want the tab bar to appear when the user clicks on Sign Up. And, the navigation controller only allows for right to left and left to right segues and I want custom segues (I tried customizing the segues for a navigation controller and it caused a crash for me).
So my question is, does anybody know how to keep the tab bar on VC1 AFTER going to another View Controller WITHOUT a tab bar, and going back to VC1 WITH the tab bar?
Sorry for the long post.
I encountered a problem in my app.
I have to have a UINavigationBar in all my pages, and so I created a UINavigationController 'embed in' with my first page. So the UINavigationBar appears on it, but when I perform a segue from that first page (by instating a new view controller and presenting it) the navigation bar doesn't appear on the second view controller.
Check your segue is presenting or pushing a second page.
Check out segue properties, If it's presenting by selection of 'Modal' on segue property of attribute inspector. On presenting view controller you won't get your Navigation bar.
You will get Navigation bar when you push a segue.
And If you want presenting animation on push using segue, You can go for custom segue.
Here is the link.
http://www.appcoda.com/custom-segue-animations/
Let's assume that a first view controller is connected with a UITabBarController and I want to make a push segue to the second view controller from this first view controller.
From my googling, it seems that a modal segue from a view controller connected with a UITabBarController hides the bottom tab bar, while a push segue doesn't.
However, my push segue is also hiding my tab bar in the second view controller. I have overridden prepareForSegue method in the first view controller.
Below are images of my storybard and the simulator. Anyone has an idea why this is the case? Thank you in advance for your helps.
Your trouble is because your tabViewController is embedded in the navigation stack that you initialise with your login screen.
you need to rearrange things so that each of your tab bar controller tabs opens to a new navigation stack.
What I suggest
your loginscreen should navigate to your tab bar controller with a modal/presenting segue, not a push segue. Remove the navController that encloses the loginscreen, you don't need it (well, even if you keep it, don't use a push segue, use a modal segue, and you won't then be referring back to that navController's viewController stack from inside your tab bar).
embed each of the first viewControllers in your tabViewCOntroller inside a separate navController.
Now you can push segue within your tabViewController's tabs.