How to simulate navigation bar in Xcode 9 - ios

In xcode 8 we could simulate translucent navigation bar of a view controller. Is there a way to do the same thing in xcode 9?
I did the same thing as in xcode 8:screenshot, yet nothing happens.
How could we manipulate navigation bar items if there is no navigation bar simulation?
Thanks.

Not sure if this is a bug that is going away in later releases but temporarily I just made controller root view controller of navigation controller. The navigation controller never gets instantiated or segued to from anywhere but it's enough to get storyboard to look correct.

Related

Where is UINavigationItem disappearing to when refactoring views to storyboard?

I'm rewriting an Obj-C project using Swift 4 / Xcode 9.2
I have a large storyboard that I am breaking down into multiple storyboards. I did this previously without any issues. If I refactored a few views to their own storyboard then the views took the navigation item with them. now they disappear...
[
My questions are ...
Is this an Xcode bug? or a new feature?
Obviously you can work around this as I have shown in the pictures but is there a way to stop the vanishing from happening?
This is the way it's always been. In your storyboard, if a view controller is not a child of a navigation controller via root view controller or push segues, then by default no navigation bar is shown in the storyboard. You can force it on, though, by going to the Simulated Metrics section of the Attributes Inspector tab and selecting one of the navigation bar options for "Top Bar".
Your view controller is no longer a child of a navigation controller, so it no longer automatically has a navigation item. If you need it to have a navigation item, drag a Navigation Item from the Object Library onto it. You will then be able to give the navigation item a title, and drag buttons and so forth onto the navigation item.

No tab bar in one child view since Xcode 9.2 update

Since I updated to Xcode 9.2, the tab bar isn't displayed anymore in one of my child views and I'm struggling to get it back.
I did everything using the storyboard.
Here is a screenshot of it:
As you can see, the same segue is used in both views but the result is not the same...
I ended up using a small workaround. Maybe it is the right way to do it and my first implementation was wrong.
So instead of embedding the tab bar controller in a nav bar controller I ended up putting each tab in a nav bar controller.
Like this:
screenshot
And now everything is working correctly.

Xcode simulator - Navigation bar is missing

I don't know why but my navigation bar is missing from my ios simulation.
Anybody know where might be the problem?
Yes I have "Shows Navigation bar" and I don't have any warnings.
I wanted to try "Update frames" but I don't have this option available.
I am using Xcode 7.3 and Swift.
Thank you
You can solve by embedding a navigation controller:
As other people have said in the comments without showing some code or screenshot of IB it's hard to find out where the problem is... But here's some things to checkout.
Are you sure your view controller is embedded in a UINavigationController?
If you are using Storyboards you should have something like this:
In code instead you might have set the window.rootViewController property in the AppDelegate to the content view controller rather than the navigation controller which is supposed to contain it.
Its depend how to embedding navigation controller but you can try to embedding navigation controller following below way and than run application and check in simulator : Go to Editor in xcode -> Embed in -> Navigation Controller.
I had the same problem: the navigation bar was showing on the root view in Storyboard, but when running the Simulator - there was no navigation bar at the top of the views. This solved it:
Navigation Controller > Navigation Bar > UNCHECK Translucent (it is checked by default). This did two things:
My Navigation Bar shows on all subsequent views.
The topmost subview on subsequent views is now at Y=0, and not Y=64.
There are two possibilities.
1) May be you didn't Embeded navigationcontroller before your viewcontroller. so, add Navigation controller with go to
Editor -> Embededin -> Navigation controller.
2) If you have add navigation controller but May be you have set NONE as topbar of Viewcontroller.

The back button in a navigation bar is shown in ios7/ios8 but not in ios9

The device runs ios8 and the back button is properly shown and I can use a swipe gesture on the device to navigate the view stack.
On the simulator (running ios9), the back button will not appear, and the swipe gesture does not work.
UPDATE: I have updated the device to use ios9, the back button vanished.
I have now found the source for this.
In the storyboard, the navigation controllers were cascaded.
The segue of the first controller stacked another full view controller, not just the view. On that view controller, the navigation was not properly initialized.
On ios7/ios8, this made no difference, the root-navigation controller's navigation bar was used. In ios9, it seems, that the navigation bar of the initial navigation controller is overwritten or it requires specific segues to the parent navigation view.
If the swipe feature is also dependent on the missing navigation bar initialisation, I have not tested. I have removed the superfluous navigation controllers and directed the segues directly to the views and now it works.

Deformed Navigation bar

I'm not sure what happened, but while editing the title of my Navigation bar, the Navigation bar suddenly became deformed like this:
On the device, the navigation bar seems to be twice the regular height:
The navigation bar is generated by connecting a navigation controller via the storyboard. It was working fine for weeks until now. I tried the following in an attempt to remedy the problem:
Clean + Build
Restart Xcode
Restart my macbook
Turning off and on my size classes
Deleting the Navigation controller and dragging a new one back on screen.
Anyone know how to solve this problem?
Sounds more like the view controller embedded in the navigation controller is whats corrupt.
Did you try re-creating the view controller as well?

Resources