0

I have an app with a single view controller.

This code:

NSLog(@"%@", NSStringFromUIEdgeInsets(self.view.safeAreaInsets));

Logs this:

{0, 0, 0, 0}

Apple documentation states:

For the view controller's root view, the insets account for the status bar, other visible bars, and any additional insets that you specified using the additionalSafeAreaInsets property of your view controller.

Why does it return 0 then? Shouldn't it return the size of the status bar? Where can I find the height of the status bar? Where can I find the height of the app switcher at the bottom? The app switcher is the line element that you swipe up to switch between apps.

Vulkan
  • 1,004
  • 16
  • 44
  • 2
    https://stackoverflow.com/a/25973816/6901471 – kbunarjo Sep 30 '22 at 16:15
  • What about the app switcher height at the bottom? How can I get that? – Vulkan Sep 30 '22 at 16:27
  • 1
    @Vulkan - where are you calling that? Running simple, single-view controller app on iPhone 13 Pro, I get `{0, 0, 0, 0}` in `viewDidLoad` (as we know, auto-layout has not done all it's work yet), and `{47, 0, 34, 0}` in `viewDidAppear` (*after* auto-layout has run its course). – DonMag Oct 03 '22 at 13:07
  • I'm using the viewDidLoad. Thanks for the clarification. Didn't know that! – Vulkan Oct 03 '22 at 16:28

0 Answers0