Search code examples
iosxcodeautolayoutiphone-x

There is no SafeArea option for xib files


I'm trying to update my apps for the iPhoneX and there is no 'SafeArea' guides. Are they only in Storyboards, not individual nibs?


Solution

  • Safe Area Layout Guides are also available in nibs. When you create a new nib file in Xcode 9 they will be automatically activated. If you your nibs were created with Xcode 8 (or older) you have to activate them:

    1. Select your nib file in the Project Navigator:

    enter image description here

    1. Activate Safe Area Layout Guides in the File Inspector:

    enter image description here

    To activate the Safe Area Layout Guides for a Storyboard you have to also select the Scene in the editor to get the checkbox in the File Inspector.