Can't use safe areas in Xcode 9 after upgrading minimum deployment target to iOS 9

17.1k views Asked by At

I have just changed my app from supporting iOS 8 and up to supporting iOS 9 and up. I believe I've done this properly, since when I now build my app, I'm getting warnings for everything in the app which was deprecated in iOS 9.

I am using Xcode 9, GM seed.

The problem is that I cannot enable the "Use Safe Area Layout Guides" toggle in any of my storyboards. When I do, I get a warning "Safe Area Layout Guide before iOS 9.0". Is there some additional setting that I need to update? A clean and build did not fix the problem.

4

There are 4 answers

3
Jordan Wood On BEST ANSWER

I didn't try quitting Xcode and restarting it before posting to SO! Sorry! The answer is, quit Xcode and try again.

2
Sti On

When you changed the deployment target, did it automatically change the deployment target in your storyboard? (File inspector when opening the Storyboard)

Storyboard File Inspector

Did you update the deployment target in both the Project and in (all) your target(s)?

Project:

Project

Target:

Target

3
zhengwu119 On

Just deselect "Use Safe Area Layout Guides" option, which should fix this. A screenshot below may point you the right direction. Hope this image can help

alt screenshot

1
Shobhit C On

Simple fix.

In file inspector for the view, look for Builds For in Interface Builder Document and in there select iOS 9 and later.