topLayoutGuide is incorrect if child view controller has origin.x < 0

Number:rdar://35877771 Date Originated:December 6 2017
Status:Open Resolved:
Product:UIKit Product Version:iOS 10
Classification:UI/Usability Reproducible:Always
This does not affect iOS 11.

For iOS <11 the `-[UIViewController topLayoutGuide]` is not calculated correctly within a container view controller which has a child view controller which is a `UINavigationController` with a frame where origin.x < 0. The top view controller of the navigation controller will have an incorrect `topLayoutGuide`.

Steps to Reproduce:
Launch the attached project on a iOS 9/10 device/simulator in Portrait. 

If you change line 57 in `ContainerViewController` to have a none-negative x-origin, you will see the expected result.

    leftFrame.origin.x -= 1; // If x < 0 the topLayoutGuide is not calculated correctly

Expected Results:
The left view should have a 20pt border to the navigation bar.

Actual Results:
The left view has no border to the navigation bar

Xcode Version 9.0.1 (9A1004)

MacBook Pro (Retina, 15-inch, Mid 2015)
macOS 10.13.2 Beta (17C85a)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!