EDIT: as Ken Thomas said, I'm completely wrong here!
Yes, both of the constraint systems you specify should cause the values ββof parent and subview (or parent and contentView ) to have the same width.
So, I would ask, are you absolutely sure that what you see is that the contentView does not fill the parent? Is it possible that what you see in the broken case is that the parent element actually shrinks to fit the contents of the View, and you don't notice it because the parent has a transparent or otherwise invisible background?
To test this, set the contentView and parent different opaque background colors. If I am mistaken, you will clearly see a background area where the parent expands the width greater than the contentView. If I am right, the contentView completely covers the parent width.
That's why I (perhaps presumptuously) interrogate your stated fact about what you see:
The key difference in the log output is that for the broken case, we see an unexpected constraint that contains a UIView with a fixed width of 320:
<NSLayoutConstraint:0x8433f8f0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x841b9f40(320)]>
What kind? Based on the constraint name βUIView-Encapsulated-Layout-Widthβ, it is associated with the UIViewControllerWrapperView and that the width is held up to 320 (iPhone width), we can deduce that this restriction is automatically created by UIKit to limit the size of the UICollectionView.view to the screen size. If you look at all the constraints, you can see that this width constraint = 320 is passed along the chain of constraints (encapsulated-view β DetailView β DetailWeatherView) until finally the width of the DetalWeatherView , which is your parent and which uses the supview- constraints, is determined edge-offset for hugging the contentView , so it should also get the same width of 320.
In contrast, for a case that works, you can also see the same chain of constraints, which should restrict contentView.width to equal the width of the top encapsulated layout view. But the difference is that there is no restriction anywhere that contains something with a fixed value of 320. Instead, there is only a left alignment restriction.
Thus, I would expect to see this in both cases contentView.width == parent.width , but in the broken case width = 320, while in the working case, the width is determined by internal constraints with a lower priority inside the contentView , which allow you to expand it to the value greater than 320, possibly in its intrinsicContentSize.