I've started learning the new Auto Layout stuff in XCode on iOS. Auto Layout is actually quite neat, but it appears to be a pain to test. I seem to remember on the Mac side there was a way you could Preview an interface and drag it to different sizes to test if controls lined up properly. Is there anything like this for iOS or some tool to facilitate testing your AutoLayout views? Additionally, something to switch to Right to Left would be useful too. I just want to test all my constraints and make sure they're perfect.
To view a preview of what Auto Layout will do under different conditions, do the following in Xcode 5:
To simulate a right-to-left language, according to the WWDC 2012 Auto Layout by Example (Session 232) video:
AppleTextDirection YES
NSForceRightToLeftWritingDirection YES
More arguments that can help with Auto Layout can be found here.
If you have localized strings, you can go to the Xcode Product menu then pick Scheme ---> Edit Scheme. In the top section on the right (Arguments Passed On Launch), click the + button and then type in: -NSDoubleLocalizedStrings YES and make sure the check box next to it is checked. This will double all your localized strings to simulate a language like German that tends to have long words.
Thanks to Apple we have the live preview in the new XCode 5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With