Xcode 9, Interface Builder, Layout Margins, and iOS 10

The short version: using storyboards in Xcode 9, is there any way to set up layout margins that works in iOS 10?


The long version: if I open my project in Xcode 9 and run it, then it looks correct in iOS 11, but it's a mess in iOS 10. Anywhere I've set custom layout margins, it's using the default values instead. I assume this is because there are significant changes to layout margins in iOS 11, and Xcode is building a storyboard that's set up using those new methods. It's worth noting that I do have my "Builds for" setting set to "Deployment Target (10.0)".


Earlier today I noticed an Xcode warning that said "Language directional layout margins before iOS 11.0". I'm not sure if that's new in beta 5, or just something I missed before. I took a closer look and it turned out Xcode 9 had updated all of my layout constraints to use the new "respect language direction" setting. I thought addressing that issue might solve my problem, but it did not. All it seems to have accomplished is getting rid of the error.


Is there any way to solve this issue using Interface Builder, or am I going to have to set up all my layout margins in code just to keep iOS 10 compatibility?


Related bonus topic: I haven't done much with "Safe Area Layout Guides" at this point, but I know that's going to be an issue too. Has anyone figured out the best way to turn that option on while preserving iOS 10 compatibility? This talk says they are "backwards deployable". I'm not sure what that's supposed to mean exactly, but I've tried turning it on, and I'm seeing large gaps at the top of all my views in iOS 10. I guess maybe there's a reason they said "deployable" and not "compatible"?

Replies

I would stick w/iOS 11 only, until later in the Xcode 9 beta cycle...

I'm having a tremendous amount of difficulty with IB in Xcode 9. Stuff that took me 5 seconds in Xcode 8 has monopolized my day. It's annoying to turn something that worked pretty well upside down in return for nothing but grief.