I find auto layout a serious bother, especially with the fact that I can’t explicitly control the parent of a control (typically a container).
I have a view that consists of three containers (and a few buttons, but they are irrelevant at this point) that lie on top of each other. In order to correctly control the z-order, I have positioned them off the edge of the iPad using auto layout constraints in the IDE. This lets me deal with the z-order and keeps the IDE from “helping” me by changing the parent.
Each container has a top and left constraint. They are named top1, left1, top2, left2… What I need to do to position the containers correctly is set the offset of the top and left constraints to zero.
What I did:
Basically I loop through the constraints looking for the the correct one (top/left) for the control (container in this case) in question. If found, I change the offset.
If anyone thinks this is a useful/good idea, I’ll post the code.
-Bob Gordon (who really dislikes auto layout)