I have a UIScrollview is acting inconsistently in regards to fitting the screen width. When I run the same build over multiple times it varies from this incorrectly rendered view:
[Incorrect view]

to this correctly rendered view:
[Correct view]

When the view does render correctly the scroll works as expected but when it renders incorrectly it does not scroll at all but the image width seems to render fine.
The view hierarchy is View>Safe Area> Scroll view> Content View. I have constrained the width of Content View to equal to the top view and also setts the constrains (0,0,0,0) for scroll and Content View . The other issues is my view is going behind the top bar even though I have disable the extend edges feature in storyboard. I have also tried setting the Scroll View size in code with the following:
let size = UIScreen.main.bounds.size self.scrollView.contentSize = CGSize(width: size.width, height: size.height)
In the debugger for each render look like this. Notice that VC escapes the navigation VC
Any help would be appreciated