Posts

Post not yet marked as solved
1 Replies
2.1k Views
I filed a radar for this almost 2 weeks ago, but given that "Recent Similar Reports" says "Less than 10", I need to raise awarenesss about this issue some more. (Radar ID is FB6155727 in case anyone at Apple is reading this!)When Xcode 11 opens a storyboard with constraints applied to two views, where one of the views is a child of a UIStackView (and perhaps any UIView as well?) and the other is not a direct sibling to the view in the UIStackView, it deems these constraints invalid, where older versions of Xcode have supported this functionality for years. It's very useful to be able to align a view relative to where a stack view decides to place it, but Xcode 11 removes these important constraints, rendering any layout using this broken.As someone who relies heavily on UIStackView for relatively-sized layouts that scale well across devices, this is a major breaking change that has broken all of my apps. The only way to fix it at this point is reverting to manual layout, or at the very least writing a bunch of band-aid code that manually manipulates the constants of constraints while the app is running, doing the work that Auto Layout has done on its own for years.If you want to see the bug firsthand, here's a storyboard that demonstrates it:https://www.icloud.com/iclouddrive/0iEqTvuKPrBVGuF20BmR2CoEQ#Main.storyboardSteps to reproduce:Open the attached storyboard in Xcode 10.Observe the constraints on ControlBarCollectionView (the view targeting its position to that of a view in the stack view). Here's how they look on Xcode 10, but feel free to look closer at how they're interacting with the child of the stack view named "Control Bar Alignment Target":To4GM74.pngkm5x0Jj.pngSave a copy of this storyboard (or be ready to download the copy I've attached again), because Xcode 11 will modify the file without being able to undo the changes.Open a copy of the storyboard in Xcode 11… get a new error message:323htij.pngAfter checking the error message it gives, observe the storyboard now, notice how the important constraints have been irreversibly removed (barring a `git reset --hard`, at least):V9iFw1F.pngIt's imperative that anyone else who's having this problem files a radar about it, as Apple generally prioritizes these fixes by number of reports.And again, if anyone at Apple is reading this, the radar ID is FB6155727. I hope you understand how what seems to be a small bug can totally break entire layouts, and how big of a problem this is for me. And while I hope this change wasn't intentional, I don't see why it would be. It seems to be something that was accidentally removed during a refactor in Xcode 11… but I and surely many others really need it put back. Thank you for reading, I appreciate it.
Posted Last updated
.