19

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.

Jordan Wood
  • 2,727
  • 3
  • 12
  • 17

4 Answers4

42

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

zhengwu119
  • 543
  • 3
  • 6
  • 5
    Unchecking "Use Safe Area Layout Guides" will suppress the error but I suggest you to set your Deployment Target to at least 9.0. Safe Areas are very much needed for designing your app for the iPhone X. Please do not neglect them. They play a huge role in iOS app for the iPhone X. Here is a detailed explanation about safe areas : https://developer.apple.com/documentation/uikit/uiview/positioning_content_relative_to_the_safe_area – Rizwan Ahmed Nov 10 '17 at 19:49
  • Yes @RizwanAhmed. What should we do in the case we wants to use Safe area layout guide in iOS 8 then? – Jayeshkumar Sojitra Nov 24 '17 at 04:47
  • @JayeshSojitra In my opinion you should stop supporting iOS8. I would suggest you to look at the stats of your app and see how many active users are there in iOS 8. ( I believe there will be only a few) – Rizwan Ahmed Nov 24 '17 at 04:50
14

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

Sti
  • 8,275
  • 9
  • 62
  • 124
  • Thanks for the help, I did do those things. As you can see, I just managed to confuse Xcode, but a good knock upside the head sorted it. – Jordan Wood Sep 16 '17 at 02:59
  • @JordanWood Damnit! I was so close to suggesting that as well. A restart helps more than it should, sometimes :) – Sti Sep 16 '17 at 07:10
8

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

Jordan Wood
  • 2,727
  • 3
  • 12
  • 17
  • I wouldn't apologise - this is a bug. You can submit it in a bug report but you've got a very slim chance of it getting fixed. Unfortunately Apple's priorities are far higher for marketing than for development. – amergin Nov 04 '17 at 11:48
  • The 'Builds for: Deployment Target' configured in IB does not appear to match the correct version when switching between different Xcode projects. Restarting Xcode will make it match up with your project settings again. (Xcode 9.0.1) – Gerard Nov 14 '17 at 12:39
  • These days XCode comply to the IT question "Did you try turning it off and on again?". smh – GeneCode Sep 25 '18 at 12:06
3

Simple fix.

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

Shobhit C
  • 828
  • 10
  • 15