sudotristan

Q: Xcode 8 (8A218a) Interface Builder Auto Layout Issues

I have been frequently experiencing issues in interface builder when using UIScrollView and UIStackView. When I configure my scene for the first time, all is well. There are no constraint issues, everything looks fine in Interface Builder, and the scene renders properly at runtime.

 

However, often when I close Xcode and reopen it, I will find that views in the scene in question (see attached) are gone. Upon looking through the view hierarchy, it appears that the UIStackViews (descendants of the UIScrollView) are taking up way more space than they should. As you can see in the attached images, the height of the UIStackView's children is 1,000 points. These should actually be around 50 points (and are so at runtime). Of course, all of the views within said view move accordingly, which is why all of the content appears to be missing; it has all moved outside of the scenes frame in Interface Builder.

 

Everything still works properly in the simulator. The issue appears to be within Interface Builder. I have tried just about everything I can think of to fix it. This ranges from reconstructing the entire view hierarchy, to refreshing all views, to restarting Xcode again. Nothing seems to work except rebuilding the scene again (which eventually does this all over again).

 

This "bug" makes Interface Builder practically unusable for my work.

 

Thoughts anyone?

 

Screen Shot 2016-09-25 at 10.31.48 AM.png

Screen Shot 2016-09-25 at 10.57.38 AM.png

iPhone 7 Plus, iOS 9, The build target is iOS 9.0

Posted on Sep 25, 2016 11:10 AM