Working with Layout Constraints

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)

AL is one (of many reasons) I never pursued “Xojo for iOS”… even Apple doesn’t mandate that AL must be used, as a matter of fact all my personal iOS projects not only do not use AL, but they don’t use Storyboards, XIB or NIB files, which allow 100% freedom in how each device best makes use of its real-estate, resulting in a much (my opinion) more flexible UX.

I have developed my own drag-n-drop UI builder that writes all the code and does all the required calculations, giving me the ability to create a working set of views in a matter of minutes.