1

I am new to work with xcode 9.2 and iOS 11.2. When I stared new project i got error symbol on storyboard about safe area. If i will not use storyboard and I will design my view programmatically then safe area will effect on my design? I mean on iOS 11 ?

Thanks

Bhavsang Jam
  • 374
  • 4
  • 12
  • 1
    Well, [that's the offical documentation](https://developer.apple.com/documentation/uikit/uiview/positioning_content_relative_to_the_safe_area), but if you google around a little, you can find things [like this for example](https://useyourloaf.com/blog/safe-area-layout-guide/) – MadProgrammer Apr 11 '18 at 08:27
  • Thank you for your response. – Bhavsang Jam Apr 11 '18 at 09:48

3 Answers3

4

Safe Area is a layout guide (LINK).

The layout guide representing the portion of your view that is unobscured by bars and other content. In iOS 11+, Apple is deprecating the top and bottom layout guides and replacing them with a single safe area layout guide

Since iPhone X’s status bar height is different from all previous iPhone, this causes Label-A to be mispositioned below the status bar.

enter image description here

To fix this, we will need to use “Safe Area Layout Guides” that being introduced in Xcode 9 interface builder.

enter image description here

For more about SAFE AREA you should read this LINK

Rashed
  • 2,349
  • 11
  • 26
1

The Safe Area Layout Guide helps avoid underlapping System UI elements when positioning content and controls

The Safe Area is the area in between System UI elements which are Status Bar, Navigation Bar and Tool Bar or Tab Bar, So when you add a Status bar to your app, the Safe Area shrink. When you add a Navigation Bar to your app, the Safe Area shrinks again.

On the iPhone X, the Safe Area provides additional inset from the top and bottom screen edges in portrait even when no bar is shown. In landscape, the Safe Area is inset from the sides of the screens and the home indicator.

This is taken from Apple's video Designing for iPhone X where they also visualize how different elements affect the Safe Area.

For detail look at this

Aleem
  • 3,173
  • 5
  • 33
  • 71
0

Safe area has been introduced with iOS 11 for iPhone X.

You can learn more here:

Safe Area Guide

MRizwan33
  • 2,723
  • 6
  • 31
  • 42
Zaphod
  • 6,758
  • 3
  • 40
  • 60