I am trying to make a UIButton that grows when pressed. Currently i have the following code in my button's down event (courtesy of Tim's answer):
#define button_grow_amount 1.2
CGRect currentFrame = button.frame;
CGRect newFrame = CGRectMake(currentFrame.origin.x - currentFrame.size.width / button_grow_amount,
currentFrame.origin.y - currentFrame.size.height / button_grow_amount,
currentFrame.size.width * button_grow_amount,
currentFrame.size.height * button_grow_amount);
button.frame = newFrame;
However when run this makes my button move up and to the left every time it's pressed. Any ideas?