Fixes GridCollectionViewCell "Unable to simultaneously satisfy constraints" runtime error

This commit is contained in:
Riley Testut 2023-06-16 15:18:02 -05:00
parent 731de7023f
commit 21147969ea

View File

@ -116,6 +116,7 @@ class GridCollectionViewCell: UICollectionViewCell
self.imageViewWidthConstraint.isActive = true self.imageViewWidthConstraint.isActive = true
self.imageViewHeightConstraint = self.imageView.heightAnchor.constraint(equalToConstant: self.maximumImageSize.height) self.imageViewHeightConstraint = self.imageView.heightAnchor.constraint(equalToConstant: self.maximumImageSize.height)
self.imageViewHeightConstraint.priority = UILayoutPriority(999) // Fixes "Unable to simultaneously satisfy constraints" runtime error when inserting new grid row.
self.imageViewHeightConstraint.isActive = true self.imageViewHeightConstraint.isActive = true