All restrictions express a formula of the form:
firstItem.firstItemAttribute == secondItem.secondItemAttribute * multiplier + constant
(The ratio can also be <= or >= .)
Most often, the multiplier is 1, so remove it:
firstItem.firstItemAttribute == secondItem.secondItemAttribute + constant
It is usually easier to think in terms of positive constants. So something like:
view.Top == superview.Top + 20
has the meaning. The top of the top is 20 points below the top panel. (In the coordinate system used by automatic layout, Y increases downward, so adding 20 points gives the position "lower.")
You can switch elements around, but if you need the same relationship, you will need to negate the constant:
superview.Top == view.Top + -20
That -20 may make it harder to understand. By the way, Xcode will happily replace two elements and negate the constant for you. (If the factor was not 1, the math gets a little more complicated, but it is still possible.)
If you simply changed objects around, but did not deny the constant, this would express a different attitude:
superview.Top == view.Top + 20
This would mean that the top of the supervisor would be below the top of the view. Or rather, that the view will be located above the top of the supervisor, and the top will be cropped.
Now the constraints on the other end are most often expressed by elements in a different order, because you usually want the relationship to be the opposite. That is, you want the top of the top level to be below the top level of the top, but you want the bottom of the view to be higher than the bottom bottom panel. Thus, a constant is positive only when you order the elements in a different order:
superview.Bottom == view.Bottom + 20