I am using a UICollectionVewCell with custom layout in which height of the different cell varies from cell to cell. I have used approach described here https://www.raywenderlich.com/107439/uicollectionview-custom-layout-tutorial-pinterest
I have setup the cell in the storyboard and all the constraints seem to be happy with each other. When I run the code, I get cell layout exactly what I want. No problem there.
Problem is that in the log I see a NSAutoresizingMaskLayoutConstraint that seems to be in conflict with the constraints that I have put myself. The NSAutoresizingMaskLayoutConstraint is something the xcode is adding itself. This constraint is being automatically put by xcode on the CollectionViewCell's own content view (this content view is visible only in the view hierarchy and not in the document outline).
2017-02-19 21:54:28.999546 TestProject[6612:395125] [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)
( "", "", "", "", "", "", "" )
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
I see quite a few other people have similar issues but following those posts and trying all the solutions listed there has not helped me in getting rid of this error/conflict in constraints. Some of the posts that I had tried following are Unable to simultaneously satisfy constraints, will attempt to recover by breaking constraint How to trap on UIViewAlertForUnsatisfiableConstraints?
One of the solutions that come almost close to fixing it but not completely is to change the priority of the constraint that to 999. But this adds small empty that doesn't look good.
Any suggestions of how I can remove this NSAutoresizingMaskLayoutConstraint warning without having to change the constraints that I have manually put?
Thanks.