I have a UIImageView embedded in a UIView. My entire app uses AutoLayout, but I want to remove constraints for the
you can call
[yourElement removeFromSuperview];
and then call
[yourSuperview addSubview:yourElement];
to remove all constraints from yourElement and add it back to the view.
It is worth mentioning that if you are doing the above on something like a UIView category or extension, you need to save a reference to the view's superview before removing from superview:
var theSuperview = self.superview
self.removeFromSuperview()
theSuperview?.addSubview(self)
You might also need to make yourElement strong instead of weak since removing from superview could potentially cause you to lose a reference to it.