Safe area insets not updated to account for navigation bar

Originator:jonathan
Number:rdar://45411888 Date Originated:10/19/2018
Status: Resolved:
Product:iOS + SDK (UIKit) Product Version:iOS 12
Classification: Reproducible:Always
 
Summary:
In my navigation flow, the safe area insets are not being updated to account for the navigation bar after a push navigation transition. Three things need to be true for this to happen:
1) The navigation bar needs to be opaque
2) The navigation bar needs to be set to hidden in the first ViewController and visible in the second ViewController
3) A custom transition animation needs to be enabled
When this bug occurs, views that are aligned with the top safe area guide underlap the navigation bar. The bug is "fixed" by showing and dismissing a modal ViewController over the problematic navigation controller.

Steps to Reproduce:
Build and run the sample project (https://github.com/jburns20/NavigationControllerBug)
Click "next"
Observe that the blue square does not appear at the top of the screen.
Click "show modal" and then "dismiss"
Observe that the blue square has appeared at the top of the screen.

Expected Results:
The blue square should always appear at the top of the second view controller.

Actual Results:
The blue square sometimes does not appear at the top of the second view controller.

Version/Build:
iOS 12, Xcode 10.0

Configuration:
iPhone X / iPhone XR Simulator

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!