From df07fa85d5f727445c966177698a2ec98c068acf Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 4 Dec 2022 12:17:31 -0500 Subject: [PATCH] Fix unsatisfiable constraints warning for ZeroHeightCollectionViewCell --- Tusker/Views/ZeroHeightCollectionViewCell.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/ZeroHeightCollectionViewCell.swift b/Tusker/Views/ZeroHeightCollectionViewCell.swift index 5cb01044..043570ca 100644 --- a/Tusker/Views/ZeroHeightCollectionViewCell.swift +++ b/Tusker/Views/ZeroHeightCollectionViewCell.swift @@ -12,7 +12,12 @@ class ZeroHeightCollectionViewCell: UICollectionViewCell { override init(frame: CGRect) { super.init(frame: frame) - heightAnchor.constraint(equalToConstant: 0).isActive = true + // sometimes the collection view imposes a height constraint initially + // (though the zero height one still takes effect later) + // and we want to suppress the unsatisfiable constraints warning + let constraint = heightAnchor.constraint(equalToConstant: 0) + constraint.priority = .init(999) + constraint.isActive = true } required init?(coder: NSCoder) {