DevPrep

All topics › Auto Layout

What are safe area and layout margins?

Junior PRO

Safe area

The safe area is the part of a view not covered by system UI: the status bar, Dynamic Island, home indicator, navigation bar, tab bar, as well as the keyboard on iPad and the "ears" on external displays. Content that must be visible and tappable is pinned to view.safeAreaLayoutGuide; backgrounds, images and scrollable content go to the view's edges so they extend under the bars.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store