Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

Here is a before and after of one of my screens after I upgraded to Xcode 8.
All I did was open up my main.storyboard and from there, I built and ran my app on my phone.
In my version control, I can see Xcode is doing a lot of changes to my main.storyboard just from me opening it.
Whenever I delete those changes, I can see what I use to see in Xcode 7.3.1.
But, as soon as I re-open interface builder with my storyboard, I see those changes come back into place.

Is there something I can do here?

Before Xcode 8

enter image description here

After update to Xcode 8

enter image description here

share|improve this question
    
Try opening up XCode 8 again with a fresh source (stash any changes it's made previously). Now, when you open up the storyboard, highlight all of your UI items and click "Update Frames". This might fix your problem. – d1str0 Sep 15 at 17:29
3  
Could you file a bug at bugreport.apple.com and attach the storyboard for which this is happening? We would like to analyze this further. – Quinn Taylor Sep 15 at 20:10
1  
I have the exact same problem. After opening my storyboard in Xcode8 and accepting the "Choose an initial device view" Dialog, everyting is acting strange. When I update all frames, the IB looks good, but after building, the app is totally broken. Tested it with 4 apps. – Cherrypig Sep 17 at 15:29
    
@QuinnTaylor I'm having a similar problem, after Xcode 8 converts my storyboard the UIImageViews in UITableViews do not show any content although their outline is visible in Debug View Hierarchy. Other objects of the same class that are in UICollectionViews are not the affected. – Manuel Sep 17 at 19:16
    
XIB or Storyboard set default as older version 7.x and Save and Close. Temporary solution, but works. Don't open again once you have done Save and Close. Otherwise again need follow same steps from begin. – Bhavesh Kumbhani Sep 23 at 5:48

11 Answers 11

I had a similar problem with tableview images not appearing once I converted the storyboard file to be Xcode8 compatible. This looks like a bug with Xcode8, so until a bug fix is released, here is a work around:

  1. Open your storyboard in Xcode 8 and choose an initial device view. Make changes as you normally would.
  2. Once you have completed your changes, select the storyboard -> File Inspector -> Opens in -> Select 'Xcode 7.x'.

enter image description here

  1. Select 'Save and Close' when prompted
  2. Your storyboard changes will be saved, and your storyboard will function as it did pre-Xcode8.

When you need to make other changes to the storyboard file, follow these steps again.

share|improve this answer
1  
Worked for me. Thank you so much... – Sathi Reddy Sep 21 at 7:03
    
Wow +1 for this for sure. I struggled with this in iOS 10 within my TodayExtension. It wasn't until I narrowed things down, analyzing the git diffs, that I saw suspect storyboard xml edits being added by Xcode 8. After saving the storyboard document for Xcode 7 (after making my edits), I can now build and ship using Xcode 8 for iOS 10. Thanks. – John Erck Sep 21 at 18:09
    
It sure looks a bug. Saving as Opens in Xcode 7.x worked for me as a temporary workaround. – Steve A Sep 21 at 19:54
    
i spent past 3 days on fixing all the broken layout from place to place in Xcode8 until i found this post. i probably should trust people like you guys more than Apple. can't believe this wasted so much of my time. Thank you very much David for this! – Xu Yin Sep 23 at 21:17
    
@XuYin Should we do this for every storyboard? I mean what if I have another storyboard in my project? What about Xib files? should I do it for those as well? – Honey Sep 27 at 20:00

I have a very similar problem. Every time I re-open my Xcode project, Xcode 8 sets all subviews in one VC in one particular UITableViewCell to 1.000 width and height. Already sent a bug report to Apple...

enter image description here

share|improve this answer
    
I have same problem, did you fixed it? – Mirza Delic Sep 17 at 23:46
    
Just saw your comment. No, unfortunately not... Have you found a solution in the meantime? – specialized95 Sep 20 at 0:20
    
No, i am waiting for xcode update, i hope they will fix it. – Mirza Delic Sep 20 at 5:25
2  
still have the annoying bug,don't know why apple creates such problems every time – Shabeer Ali Sep 20 at 6:43
    
Any one got any solution on it. i am also waiting for the solution. – Ayaz Sep 25 at 4:48

XIB or Storyboard set default as older version 7.x and Save and Close. Temporary solution, but works. Don't open again once you have done Save and Close. Otherwise again need follow same steps from begin.enter image description here

share|improve this answer
    
that worked, thank you! – sancheese Sep 29 at 11:30
1  
This doesn't help because I need to work on the file. All this does is save the file for backwards compatibility. It doesn't allow the xib to be edited in Xcode 8. – jowie Oct 3 at 15:42

Please follow the threads for any possible solution:(I believe it happens to many developers).
Xcode 8 GM seed Storyboard issue
Xcode 8 - Previous storyboards getting distorted

(I used anyH anyW width 600) When Xcode updated to Xcode 8 it changed all my ViewControllers size. As a result all the layout was distorted.
Currently I see only 3 solution for the issue (I wouldn't trust on waiting for fix soon).

1.Go for each Viewcontroller and fix it it by Update Frames.

2.Go to the main ViewController Size Inspector -> Freeform -> 600 as most of the controllers are inferred it will change the size for all of them.(Be careful on the impact of new Features Apple my want to introduce).

3.Discard the changes in git for the storyboard (I would't suggest it because Apple also inserted some updates which may be important to Xcode).

Additional link for the new AutoLayout features in Xcode 8 (WWDC16): Making Apps Adaptive, Part 1

share|improve this answer
1  
Option 1 is the most sensible and it worked for me. As Mike.R notes, be careful of trying to 'trick' XCode into fixing things as more trouble down the track is inevitable. – arcady bob Sep 27 at 6:05
    
I used option 1 as well (I think its more safe). But its time consuming. – Mike.R Sep 27 at 11:12

Setting View Size to Freeform from Inferred worked for me. It can be found under the heading Simulated Metrics in Attributes Inspector.

share|improve this answer

In my case works solutions suggested by Akhil Kateja and I also need to reset Width and Height of the main view:

1) Set View Size to Free Form

enter image description here

2) Reset Width and Height of the view to the original size:

enter image description here

Finally save and you are done.

share|improve this answer

in my case same problembefore its perfect after restart the xcode8.0 enter code here Please Suggest me if any body find any solution Thanks in Advance. before its perfect after restart the xcode8.0 enter code here Please Suggest me if any body find any solution Thanks in Advance.

share|improve this answer

Xcode 8.1 Beta 2 resolves this issue. Please check this download link

https://developer.apple.com/download/

share|improve this answer

I had the same problem and I've solved it by force update the controller's view constraints. Put the following code in your viewDidLoad() function

self.view.layoutIfNeeded()
share|improve this answer
    
Cheers Bill! that 'layoutIfNeeded' worked for me! (After trying everything else for hours..) – Ethan Halprin 13 hours ago

I have a similar issue since I installed Xcode 8. I open a xib file, do not modify anything inside, compile and the app layout becomes weird. Some images are lost in my tableviews, as well as tableview insets that seems modified.

I know a bug was reported to Apple, any other tip to be able to edit xib's without facing this issue ?

I spent 3 days trying to understand what was wrong !

Thanks

share|improve this answer

I selected each controller and clicked on "Update Frames" and it fixed the layout.

share|improve this answer

protected by Community Sep 19 at 10:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.