Zero safe area in landscape mode in Xcode?

270 views Asked by At

I have a simple UIViewController and just try to add a subview which fullfills all available safe area. The result with xib, storyboard and sometimes programmatically is the same - Xcode ignores safe area in landscape mode: enter image description here

The result I expect is approximate the following (side distances to safe area):

enter image description here

How to achieve such behaviour?

1

There are 1 answers

0
Gargo On

Found out that Xcode xibs and storyboards ignore horizontal safe area but apply it later.

The problem of my concrete case is I used SOPullUpControl and wanted to customise its container before presenting. The problem is SOPullUpControl involves view frames but safe area insets appear after view controller presentation only. So SOPullUpControl can be fully initialised when its container is on screen only.