I have a problem trying to update my UILabel restrictions for my collectible ViewCell. My prototype cell looks like this:

My goal: I need to edit the red constraint constant of the top label, depending on whether I hide or not the green label.
How did I go on?
I added an IBoutlet to restrict the red label (the one with the red arrow):
@IBOutlet weak var descriptionTopToPrice: NSLayoutConstraint!
Then:
descriptionTopToPrice.constant = 2
self.contentView.setNeedsUpdateConstraints()
But this does not work, and the restrictions are not updated.
Did I miss something?
source
share