Top/Bottom layout guide is deprecated since iOS 11.0

I've started migrating my iOS 10 app to iOS 11, however, despite migrating the project through Xcode, I'm still getting the following warnings for each view controller in each storyboard.


I've checked the source code between my migrated storyboard and a brand new iOS 11 app storyboard, and I can't see a difference.


Has anyone else come across this, and found a way to get rid of the warnings?

Thanks

Accepted Reply

From Xcode 9b1 Release Notes:



Interface Builder

UIView layout margins now have an option in the Size inspector to enable leading and trailing margins to respect RTL languages at runtime. (30086042)


Interface Builder supports the vertical baseline-to-baseline constraints added in iOS 11 that update spacing based on changes in the Dynamic Type size. (30086144)


Interface Builder now renders navigation bars, tab bars, and toolbars on the canvas in the same way they appear at runtime. (30983209)


To use the new usesAutomaticRowHeights property of NSTableView in Interface Builder, choose “Automatic (Auto Layout)” from the Size inspector and set the Row Height value. The value is used as part of the auto layout calculation. (29511510)


Interface Builder now warns when a view’s constraints can cause localization problems, such as truncation and clipping. (32141216)


Interface Builder no longer compiles for iOS 6. Documents with older deployment targets can still be read, and their frames can be transitioned to iOS 7 and later. (28726486)


Interface Builder uses UIView.safeAreaLayoutGuide as a replacement for the deprecated Top and Bottom layout guides in UIViewController. To use the new safe area, select Safe Area Layout Guides in the File inspector for the view controller, and then add constraints between your content and the new safe area anchors. This prevents your content from being obscured by top and bottom bars, and by the overscan region on tvOS. Constraints to the safe area are converted to Top and Bottom when deploying to earlier versions of iOS. (29323293)


Interface Builder supports setting textContentType on classes conforming to the UITextInputTraits protocol. This improves the ability of AutoFill to populate with appropriate data, including Username and Password on iOS 11. (25019432)


When a constraint is selected, the inspector now allows choosing a different first or second item to anchor it to. Depending on the constraint type, siblings and containers are available. Constraint constants are automatically updated to preserve current positioning. (17535216)


Replies

In iOS 11, top/bottom layout guide have been replaced with the “safe area” construct and are deprecated. You can avoid these warnings by not constraining to the top or bottom layout guides. There's some discussion on this in Session 204. That said, I’m still unclear on the alternatives when using storyboards (as opposed to writing constraints in code).

From Xcode 9b1 Release Notes:



Interface Builder

UIView layout margins now have an option in the Size inspector to enable leading and trailing margins to respect RTL languages at runtime. (30086042)


Interface Builder supports the vertical baseline-to-baseline constraints added in iOS 11 that update spacing based on changes in the Dynamic Type size. (30086144)


Interface Builder now renders navigation bars, tab bars, and toolbars on the canvas in the same way they appear at runtime. (30983209)


To use the new usesAutomaticRowHeights property of NSTableView in Interface Builder, choose “Automatic (Auto Layout)” from the Size inspector and set the Row Height value. The value is used as part of the auto layout calculation. (29511510)


Interface Builder now warns when a view’s constraints can cause localization problems, such as truncation and clipping. (32141216)


Interface Builder no longer compiles for iOS 6. Documents with older deployment targets can still be read, and their frames can be transitioned to iOS 7 and later. (28726486)


Interface Builder uses UIView.safeAreaLayoutGuide as a replacement for the deprecated Top and Bottom layout guides in UIViewController. To use the new safe area, select Safe Area Layout Guides in the File inspector for the view controller, and then add constraints between your content and the new safe area anchors. This prevents your content from being obscured by top and bottom bars, and by the overscan region on tvOS. Constraints to the safe area are converted to Top and Bottom when deploying to earlier versions of iOS. (29323293)


Interface Builder supports setting textContentType on classes conforming to the UITextInputTraits protocol. This improves the ability of AutoFill to populate with appropriate data, including Username and Password on iOS 11. (25019432)


When a constraint is selected, the inspector now allows choosing a different first or second item to anchor it to. Depending on the constraint type, siblings and containers are available. Constraint constants are automatically updated to preserve current positioning. (17535216)


I think I found a simple solution for the top/bottom layout guide being deprecated in iOS 11. It is indeed related to the new Safe Area concept.


All you need to do is open the storyboard in IB, make sure the Utilities panel is open, then select the File Inspector tab. If you look in the Interface Builder Document section of the panel you'll see a new checkbox: Use Safe Area Layout Guides.


If you check that then the warnings disappear, I guess because the constraints are now pinning views to the Safe Area, and not the top of the view.


If you check Use Safe Area Layout Guides you'll also see in the Document Outline that the Top Layout Guide and Bottom Layout Guide items are replaced by a Safe Area item.


Hope this helps!