Life without Auto Layout


Dave
 

Hi All,

I spent all of yesterday and the first part of today purging Auto Layout from my Main Game View Controller and I’m soooooo happy I did it - my XCode life is so much better! Things happen quickly again, using Auto Layout, it would takes 3 to 4 seconds to switch between the different screen sizes, e.g. iPhone 5 to 7+, now its instant.

In the end I added a “ManualLayout” Storyboard and switched off Auto Layout. I actually managed to make it work using the old style auto-resizing, so I didn’t even have to setup the frame rectangles although that would be easy to do. I now have so much control over my layout, the board looks better, because I could fine-tine the positioning which was a complete nightmare using AL and in the end I gave trying, settling for a less attractive board.

Its a shame, Auto Layout should be sooooo good, but a combo of XCode, lack of good documentation means that its just not practical to use it. In the case of this game it didn’t offer that much compared to the work involved, it really shouldn’t take 3+ days to make something that can scale from iPhone 5 to iPhone 7+………..

I think I’ve figured out how to do a portrait version too (something I would dream of doing in AL), basically I’ll just make my existing View Controller a Base Class and add a couple of subclasses for Portrait and Landscape.

Thanks to everyone that tried to help, especially Jens, who gave me the push I needed to get rid of it!

Much Happier Today!

All the Best
Dave

Join cocoa@apple-dev.groups.io to automatically receive all group messages.