How do I view sibling and ancestor constraints in Xcode 11?

Xcode 11 Interface Builder groups layout constraints into Horizontal and Vertical. While this is sometimes useful, I personally find it more helpful to organize constraints hierarchically. Is there any option to get the old Sibling & Ancestor and Descendents groupings in Xcode 11?

Replies

Pretty straightforward, I think, in that children always inherit from parents.


If you're asking for a tool/menu that allows you to visualize them, the left column in IB's editor is sorted on hierarchy, just be sure to toggle everything to show.

I have not found anything in Preferences to do that.


But the difference is minor and welcomed IMHO. The constraints (in the Size inspector I mean) are ordered in the same way as before, just split in horizontal and vertical group.


You said:

organize constraints hierarchically

What is the hierarchy you don't find in XCode 11 (in horizontal or vertical groups) ?

I like to group controls into larger views, lay out the child controls within their parent views, and then create layout constraints between the parent views. So it was helpful to have constraints with parents and siblings grouped separately from constraints with descendents.


I suppose if I work top down and create the parent views first before filling them with any components, this won't be so much of an issue, but I'm rarely creating a new storyboard from scratch. Usually I'm adding stuff to a 3-year-old storyboard and trying to learn the lay of the land.

I very much agree. This is definitely a change to the worse. Grouping them by horizontal/vertical instead of the - at least halfway - logical grouping before makes inspecting the layout a lot harder.

What would really be needed to make it intuitive is a complete redesign of the size inspector. Even reading raw xml would be more intuitive -- if the xml produced by Xcode were readable.