Content insets not adjusted in child view controller when added to parent popped from nav controller

Originator:vmagaziy
Number:rdar://FB7641663 Date Originated:27/03/2020
Status:Open Resolved:
Product:iOS Product Version:11, 12, 13
Classification:UIKit Reproducible:Always
 
When a child view controller is added at the time parent view controller is popped from the navigation view controller stack, content insets are not adjusted in the child view controller even when the popping transaction is cancelled (and thus parent view controller is returned to the navigation stack).

This issue can be reproduced on iOS 11, 12 and 13.3.1.

Steps to reproduce:
1) Open the attached Xcode project
2) Build the sample application and run it
3) Select any row in the table view
4) When an activity indicator appears swipe from the left edge of the screen causing interactively pop, but stop and do not lift the finger (see attached Screenshot1.png)
5) Wait until the activity indicator gets replaced with text and notice text is not laid out correctly -- no margins (see attached Screenshot2.png)
6) Lift the finger so interactive pop is cancelled and notice text layout is not changed (see attached Screenshot3.png)

Actual result:
Adjusted content insets are not set for scroll view in the child view controller (UITextView in the sample project)

Expected result:
Adjusted content insets are not set for scroll view in the child view controller both on step 5 and 6.

Notes:
When action 4 is not performed, i.e. the child view controller is added when parent view controller is in the navigation stack, this issue cannot be reproduced and adjusted content insets are set correctly (see attached Screenshot4.png)

-----------------------------------------------------------------------
*** Provided attachments can be found here: https://drive.google.com/file/d/12dm0c5e1R-UPXx7Vv1H5E66J50GrElbh/view?usp=sharing

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!