Xcode 7 add trailing/leading/top/bottom constraints

autolayoutios-autolayoutxcode7

In Xcode 6, I could use the Editor menu to Pin:

  • Leading Space to Superview
  • Trailing Space to Superview
  • Top Space to Superview
  • Bottom Space to Superview

I can't find a way to do this in Xcode 7 beta. If I press the Align button in the Storyboard view, I see:

  • Leading Edges
  • Trailing Edges
  • Top Edges
  • Bottom Edges

Which I assume is the same thing, but they are all greyed out.

Adding these 4 constraints in Xcode 6 would have taken about 20 seconds, but it took me 30 minutes to put it in Xcode 7 and can't figure it out.

Best Answer

Unfortunately they removed this option from the Editor Menu but there is a drop-down menu. There you can select another view to which you can assign your margins. enter image description here.