-1

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?

Gargo
  • 1,135
  • 1
  • 10
  • 21
  • @iOSDev Xcode shows that all the constraints are between this view and safe area. Additionally I tried to delete leading constraint from xib programmatically and add a new one - again between a view and safe area but it still doesn't work – Gargo Mar 03 '23 at 05:13

1 Answers1

0

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.

Gargo
  • 1,135
  • 1
  • 10
  • 21