Xcode 7 add trailing/leading/top/bottom constraints

Casey Perkins picture Casey Perkins · Jul 30, 2015 · Viewed 31.3k times · Source

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.

Answer

Mobile Developer picture Mobile Developer · Sep 30, 2015

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.