NSLayoutConstraint 'UIView-Encapsulated-Layout-Height' on UICollectionViewListCell Breaking Self Sizing Content View Constraint

I'm using compositional layout with UICollectionView. In a particular section I configure the compositional layout to use an estimated height because I want self sizing items determined by Autolayout Constraints.

Now I have a custom content configuration with autolayout constraints. At runtime I hit this log about conflicting constraints:

[LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don't want. 
Try this: 
	(1) look at each constraint and try to figure out which you don't expect; 
	(2) find the code that added the unwanted constraint or constraints and fix it. 
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 

[...]

<NSLayoutConstraint:0x6000024af160 UIImageView:0x120745520.height == 130 (active)> <NSLayoutConstraint:0x6000024af2a0 MyCustomContentView :0x120748d60.height >= 1.04839*UIImageView:0x120745520.height (active)> <NSLayoutConstraint:0x6000024b08c0 'UIView-Encapsulated-Layout-Height' UICollectionViewListCell:0x1214392f0.height == 44 (active)> Will attempt to recover by breaking constraint <NSLayoutConstraint:0x6000024af160 UIImageView:0x120745520.height == 130 (active)>


The "UIView-Encapsulated-Layout-Height" on UICollectionViewListCell with a value of 44.0 appears to be a constraint created by the system. I'm not sure why a hard coded height of 44.0 is being used when the compositional layout is returning a section that only uses estimated heights (created via NSCollectionLayoutDimension estimatedDimension).


Any ideas how I can avoid this? I'm not using custom UICollectionView cells but I am using a custom content configuration and a custom content view and setting my content configuration on a UICollectionViewListCell.

This is probably not a real issue that you need to worry about, and is only a temporary situation where the cell is has its initial default estimated height of 44 before it gets measured and properly sized to fit the content. As a workaround, you can reduce the priority of one of the constraints listed from UILayoutPriority.required (1000) to UILayoutPriority.required - 1 (999), which will allow that constraint to be broken in this temporary situation without causing this unsatisfiable constraints logging.

However, if you can reproduce this in a small sample app, please submit a feedback report containing that sample project so we can investigate and ensure this warning is not emitted in any cases where it shouldn't be.

NSLayoutConstraint 'UIView-Encapsulated-Layout-Height' on UICollectionViewListCell Breaking Self Sizing Content View Constraint
 
 
Q