Xcode 8 Storyboard warnings for Navigation Bar width [duplicate] - ios

This question already has answers here:
Warning frame for "Navigation bar" will be different at run time appears in Xcode 8 Swift 3
(14 answers)
Closed 6 years ago.
I am getting constraint warnings for my Navigation Bar's for each of my Navigation Controllers in each of my storyboards in Xcode 8.
To get rid of the warning I set the Navigation Controller's Simulated Metrics->Top Bar setting from Inferred to None and then back again, and the warning goes away. Until the next time the storyboard is opened, then the warnings come back.
My storyboard has the iPhone SE display setting, and the navigation bar's are not Translucent.

Changing the device preview from iPhone SE also removes the warning.
Xcode 8 has some serious bugs in Interface Builder: as well as this one, it has a nasty habit of random-seeming frame changes to all sorts of views - in my Main.storyboard, it decided to make some keyboard input accessory views 1,000 by 1,000 points, and everything inside it had a frame of {0,0} - {1000,1000}.
Did the same thing to various UITableViewCells, but not all of them.
Changing everything back took ages, cleaned the build folder and recompiled, but the problem came back straight away as soon as the storyboard was opened.
I had to uninstall 8 and go back to 7.3.1,
I filed a radar, saw other people with the same problem on the dev forums.

I encountered with the same problem. I am not sure that is solution or not but I just changed the Simulated Metrics size which is page size from freeform to the Page Sheet and warning dissappeard

Regarding the issues of Xcode automatically moving some views/subviews to {0, 0, 1000, 1000} frame bug, which is related to main question:
I had the same problem. Make sure to use Xcode 8.1 now as this problem is fixed in that version.
Xcode 8.1 Release notes
https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
Radars related : 28221021, 28244619
Update - Pointing the explicit frame bug solved on Xcode 8.1

Related

Xcode 8.2 & 8.1 crashes when enlarging any view in storyboard

When I click on a view frame and drag to enlarge the view, the view is not getting enlarged . But instead the mouse waiting indicator would come for a second and then the whole xcode will crash.
This was happening after my code 8.2 update. So I tried installing xcode 8.1 and the issue is still there for one particular project. All other projects are working fine. There are no warnings or conflicts in the storyboard. I don't remember changing any settings as well.
Attaching the crash log: CRASH_LOG
Fixed the issue:
The issue started after I added a ScrollView to a ViewController and changed the simulated size of the ViewController to fit the scrollview content. I changed the simulated size to freeform and the issue started to appear. I changed it back to fixed and now everything is working normal.
But I hope it shouldn't be happening and apple will fix this soon.

Navigation controller causing auto-layout issues on screens in Xcode 8

This has happened on a couple of apps I've been working on, and I believe it has something to do with Navigation bars or Tab bars. I'll work on another screen and be messing with the code and then I'll randomly scroll across the Storyboard and see that all the constraints have suddenly changed values and some items have expanded to 1000 x 1000.
Has anyone experienced this before, and know what is causing it? It's happened quite a few times to me now and it's obviously annoying to reset them each time.
Since you updated your Xcode to 8, you may need to update frames in the whole scene (once).
If you do that each time and it doesn't help, for me changing size of the storyboard helped. For example change from iPhone SE to iPhone 6 and vice-versa.
Now in Xcode 8.1 Beta version, there is a shortcut button for this.
Just select the problematic view's superview (containing mentioned constraints), and click this update frames button:

Warnings repeated in storyboard after every restart of Xcode 8 for only one ViewController

I have more than twenty viewControllers. I recently updated to Xcode 8. All are fine except one. I solved but it always shows same warnings after every restart of Xcode.
see below screenshot:
I am struggling with these issues since June, when Xcode 8 was released in its second Beta. Once I update many frames to suggested constraints, issues come back again after restarting IDE.
Rather than reconstruction of my full storyboard (as this can be caused by setting constraints in older way), I always update frames.
Now in Xcode 8.1 updated version, there is a shortcut button for this.
Just select the problematic view's superview (containing mentioned constraints), and click this update frames button:

The issue of Interface Builder in Xcode 8

My storyboards are created in Xcode 7. After I installed Xcode 8, all of them are constantly messed up. When I open one of them, Xcode asks me to select a device (which is a nice new feature). But then it never adjusts views' frames, so I must press "All View: Update Frames" infinite amount of times. And even this doesn't fix all "misplaced" views.
Anybody knows how to fight this problem? Or the only option is to pray that Apple fixes it at some point?
UPDATE 1
It happens every time I open IB, even if I've fixed frames previously.
UPDATE 2
When my colleague fixes same storyboards on his computer, changes stay. No idea what makes my Xcode so special.
I figured out the following workaround
First, set width and height for your view to the values it will calculate on selected device in your storyboard, then preserve superview margins.
This worked for me
Xcode 8.0 has the bug, that it does not save the rects from the storyboard xml-s. So if you fix misplaced views in Xcode 8.0, the problem is gone for as long as the storyboard stays in RAM. When the storyboard is closed and re-read from a file, the issue appears again. (Actually Xcode 7.0 had exactly the same problem in the beginning.)
Xcode 8.1 beta 3 (the most recent version at the time of this writing) fixes this issue:
frames are not 1000x1000, but they stay as they were.

How to make .xib files compatible to both iOS7, iOS6 and earlier [duplicate]

This question already has answers here:
Status bar and navigation bar issue in IOS7
(11 answers)
Closed 9 years ago.
I am using .xib files in my app and I am using xcode5.
If I run my app in iOS6 and earlier, the alignments are missing.
Any one know about this issue?
Do we have to create separate .xib files for iOS7 and iOS6?
EDIT: I turned off Autolayout but under iOS6, the views are still going down by 20 pixels.
If you haven't done so already, turn off AutoLayout in your xib files. Autolayout only came in with iOS 6 and newer iOS versions.
Also, you can preview what XIB files look like between iOS 6 and iOS 7 via a popup menu in the File Inspector:
in iOS7, the app windows starts from y=0px (in iOS6-, it begins at y=20px).
The quickest and easiest way to handle this, (and since you're already using Xcode5), is to switch off Autolayout and utilize the iOS6/7 Delta values for every view.
Basically:
Select every viewController's main view and uncheck "Use Autolayout"
Select every subView (UIButton, UILabel etc), go to the frame setting section
Increase their Y frame values by 20
but it seems you, #SudhakarTharigoppula, don't need to do this step.
...just do the next step
Enter a value of -20 for ΔY
This will start your app by leaving 20px in iOS7 but back in iOS6, the ΔY of -20px will compensate for the extra 20px you had given to every subView.
see: Status bar and navigation bar issue in IOS7

Resources