Isn't that the evidence from Apple Documentation?
UIKit container view controllers already adjust the safe area of their child view controllers to account for content views. For example, navigation controllers extend the safe area of their child view controllers to account for the navigation bar.
By the way, it's not a propagation. It's a more smart thing that makes a lot of sense. If you set for your ContainerViewController
its safe area to 80 points
from the bottom, and your ChildViewController
overlaps X
points of the area, UIKit
automaticall set the safe area for this child view controller to X
points, so none subviews could get out of your safe area.
For example, if you'll set you childVC
constraints like that
NSLayoutConstraint.activate([
childVC.view.heightAnchor.constraint(equalToConstant: childVCHeight),
childVC.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
childVC.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
// move childVC 30 points to the top
childVC.view.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -30)
])
In the log you'll see, that ChildViewController
safe area height is 50. This is exactly the height of overlap.