I have a rootViewController
that has a child view controller (fullScreenViewController
) whose view, from time to time, is displayed above the view (but as a subview) of the rootViewController
, taking up the full screen.
i.e.
rootViewController.addChildViewController( fullScreenViewController )
rootViewController.view.addSubview( fullScreenViewController.view )
This "full screen presentation" is done with constraints updates, not by using present()
(There's good reason for this).
When I first initialize fullScreenViewController
and add it as a child view controller of rootViewController
, then update the constraints so that it is on screen, the safeAreaInsets
are all set properly.
However, when, later on, my rootViewController
actually does present()
a modal VC, and that VC is dismiss()
ed, the safeAreaInsets
on the fullScreenViewController
are no longer correct, and the content in the fullScreenViewController
slides up on top of the status bar.
How can I force the safeAreaInsets
on fullScreenViewController
to be recalculated properly, so that they match the rootViewController
the way they do after setup?
According to the documentation, the rootViewController
should be setting the safeAreaInsets properly on all of its childViewController
s, but this doesn't seem to be the case.