44162 - iOS should have a switch to turn off Auto Layout guessing in the IDE layout editor

The iOS layout editor does a great job trying to guess what the auto layout constraints should be according to where the user places a control. However, this guess is not always perfect, and it certainly has often no idea what the user intent is.

I understand this was intended to help people not familiar with Auto Layout constraints, but it is also very unsettling, as run results sometimes differ from the IDE.

Another bad side effect of that guessing system is that if one has spent a lot of time patiently setting each constraint for each control, one cannot move anything in the IDE because it will completely change everything in unpredictable manner, and ruin the precious settings.

It would greatly help if constraints guessing could be switched off. Whatever the name of that feature, sorry if my terminology does not give it justice.

<https://xojo.com/issue/44162>

I’ve managed to work out how to live with the IDE treatment of auto-layout by never moving controls visually in the IDE but, instead, only adjusting the constraint settings. Doing it this way, I never have any surprises. So this suggestion seems like a good idea to me.

But if the IDE did not attempt to guess auto-layout constraints, then what would be the purpose of moving controls in the IDE? At runtime the controls would just follow the constraints and the IDE representation would always be, well, unrepresentative.

[quote=269973:@Jason Tait]I’ve managed to work out how to live with the IDE treatment of auto-layout by never moving controls visually in the IDE but, instead, only adjusting the constraint settings. Doing it this way, I never have any surprises. So this suggestion seems like a good idea to me.

But if the IDE did not attempt to guess auto-layout constraints, then what would be the purpose of moving controls in the IDE? At runtime the controls would just follow the constraints and the IDE representation would always be, well, unrepresentative.[/quote]

I don’t know if it is even feasible. The idea is that I noticed the IDE auto layout tends to switch relationships. For instance if you drag a control to the view, it will be relative to parent. If you add a second control, the two controls become relative to each other.

The idea is that once constraints have been set in the IDE, the layout editor stops switching relative to, moving a control simply modifies left and top.

I follow Jason’s advice and never move things in the IDE and have no problems.

What I’d like to see is a set of separate constraints for iPad to better use the real estate. For example, on an iPhone you put everything vertically but on iPad you could use 2 columns.

Layout out the views for the iPhone & iPad differently using the two initial views