I'm building a universal application with XCode, and I'm following the procedure from the 3rd chapter of "Beginning iPhone Development with Swift".
I have a view with two buttons named "left" and "right", and a label with empty text. That's how they're positioned at the beginning:
Next I add some constraints. The steps are:
- I ctrl-drag from the label to the view, and add two constraints: "center horizontally in container" and "top space to top layout guide". Then I select the label and click on "update constraints".
- For both the left and right buttons, I add a constraint: "vertical center in container".
- I add a "pin" constraint to separate the left button of 32 points from the left, and the same goes for the right button (but I add a separation from the right).
To explain this last step, that's what I add for the left button:
And that's what I add for the right button:
Next, since there are some warning, I select both the right and left buttons, and click on "update frames". This is what I end up with:
The right button is 32 points beyond the right boundary of the screen, and when I run the application the button (obviously) appears cut out. The pin constraint of the right button got automatically updated to -32 instead of 32, and if I change it again I get an error, saying that two constraints are conflicting: