Create outlets for the animationView constraints, and change their constant value.
In the .h file of the viewcontroller: Connect the outlets to the correct constraint in the IB:
//AnimationView Height Constraint
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cHeight;
//AnimationView Width Constraint
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cWidth;
//AnimationView Leading Constraint
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cLeading;
//AnimationView Top Constraint
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cTop;
In the .m file of the ViewController set the constant value of the constraints, instead of the frame:
- (IBAction)btnTouched:(id)sender {
[_cHeight setConstant:70];
[_cWidth setConstant:70];
[_cTop setConstant:20];
[_cLeading setConstant:20];
self.animationView.backgroundColor = [UIColor yellowColor];
}
It'll work fine.