Let\'s assume that I have this UIView
:
with these relativ
For animation you need to change constant of the left and top constraint instead of adding new constraint. As follows:
self.mBtnTopConstraint.constant = yourval1;
self.mBtmLeftConstraint.constant = yourval2;
[yourbtn setNeedsUpdateConstraints];
[UIView animateWithDuration:0.5 animations:^{
[yourbtn layoutIfNeeded];
} completion:^(BOOL isFinished){
}];
Hope this helps.