Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode Resolve "Safe Area Layout" errors

Illegal Configuration - Safe Area Layout Guide before iOS 9.0

What is the correct way to stop this error?

For now I'm merely unchecking "Use Safe Area Layout Guides" which allows me to compile the app without error.

like image 840
Jacksonkr Avatar asked Aug 25 '17 13:08

Jacksonkr


People also ask

How do I change the safe area in Xcode?

You can disable safe area layout guide from storyboard for particular view controller. Select View Controller -> File Inspector (first tab) -> Use safe area layout guides (uncheck the checkbox). You can also change it programmatically in viewDidLoad(). Hope this Helps!

How do I remove content layout guide?

Simply uncheck the Content Layout Guides. This option is found under the Size Inspector tab in storyboard. NOTE: This option is found under the Size Inspector tab in storyboard.

What is safe area in storyboard?

Safe areas help you place your views within the visible portion of the overall interface. UIKit-defined view controllers may position special views on top of your content. For example, a navigation controller displays a navigation bar on top of the underlying view controller's content.

What is top layout guide?

The topLayoutGuide property comes into play when a view controller is frontmost onscreen. It indicates the highest vertical extent for content that you don't want to appear behind a translucent or transparent UIKit bar (such as a status or navigation bar).


2 Answers

To resolve this issue you need to do next steps:

  1. You need to click on your ViewController in your Interface Builder.
  2. Then go to Attributes Inspector. And click there on "File Inspector".
  3. Disable "Use Safe Area Layout Guides".

Use safe area layout guides disabled

like image 199
Dmitriy Greh Avatar answered Sep 19 '22 03:09

Dmitriy Greh


Apple told us in WWDC 2017 Session 412 that Safe Area Layout Guide is Backwards deployable. But it seems to be not supporting iOS 8.0. I've got the same error on Xcode 9 GM too.

In my case, I stopped using the Safe Area Layout Guide, but use Top Layout Guide and Bottom Layout Guide, even though they are deprecated on iOS 11.

like image 27
Joey Avatar answered Sep 21 '22 03:09

Joey