I have a scrollView contains 2 child viewController. You can see VC2 not layout properly.
I found if view is not yet visible onscreen.
safeAreaInsets is always 0.
I can call vc2.view.setNeedsLayout() to fix this problem when scroll ended.
But the layout is not correct until scroll ended.
The document says
If the view is not currently installed in a view hierarchy, or is not yet visible onscreen, the edge insets in this property are 0.
So how can I fix this situation.


