Search code examples
iosswiftxcodeautolayoutnslayoutconstraint

XCode 7 How to pin to superview and not toplayout guide


I'm using the solution from this post. Autolayout: Add constraint to superview and not Top Layout Guide?

But in xcode 7, this option is no longer available. Is it moved somewhere? Or is there another way to pin to superview bypassing the toplayoutguide? I found the toplayoutguide behaving differently for ios7,8,9. Thanks!


Solution

  • It appears that they have removed the menu option, but there is an arrow next to the place where you put your top/bottom/trailing/leading margins that will still give you that option.

    Here are screenshots for the top and bottom layout guides. For some reason, I can't get the top layout guide to show up, but the bottom one is still there. enter image description here enter image description here