22

What can I do to fix Bottom layout is deprecated iOS 11, I am using Xcode 9 beta 2.

enter image description here

Krunal
  • 68,602
  • 40
  • 230
  • 241
Malik
  • 559
  • 6
  • 10

3 Answers3

28

Simply check the "Use safe area layout guides" button in the File Inspector of the IB.

use safe area layout guides

paper1111
  • 4,245
  • 2
  • 21
  • 40
  • 1
    Just to add a little clarity. To fix this in my storyboard file I had to select the storyboard and then the scene in my storyboard to get that option to appear. The option wasn't appearing when I only selected the storyboard. If you have multiple scenes you'll need to do this for each scene in that storyboard file. – xdeleon Aug 28 '17 at 11:32
  • @paper1111 It's ideal to use a red freehand circle: https://meta.stackexchange.com/questions/138031/is-there-a-joke-about-freehand-circles-that-im-oblivious-to –  Aug 30 '17 at 12:06
25

Function of @paper1111 works fine in Xcode Version 9.3.1, but for me not worked first time. After two days of World War with Interface Builder

Solution:

1) check the "Use safe area layout guides" button in the File Inspector of the Interface Builder.

2) uncheck the "Use safe area layout guides" button in the File Inspector of the Interface Builder.

3) check again the "Use safe area layout guides" button in the File Inspector of the Interface Builder.

4) (a possible additional step) clean the build folder In the menu select Product --> Clean Build Folder. Or hold Shift+Command+K

Chazz
  • 53
  • 6
Gregory Zinger
  • 251
  • 3
  • 3
3

According to this, in iOS 11, IB replaces bottomLayoutGuide by safeAreaLayoutGuide.

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)

Lawliet
  • 3,212
  • 1
  • 14
  • 25