UIButton scale on touch?

To complete the answer, the button scaling (and resetting) can be placed into methods like so:

// Scale up on button press
- (void) buttonPress:(UIButton*)button {
    button.transform = CGAffineTransformMakeScale(1.1, 1.1);
    // Do something else
}

// Scale down on button release
- (void) buttonRelease:(UIButton*)button {
    button.transform = CGAffineTransformMakeScale(1.0, 1.0);
    // Do something else
}

And connected with the button's events like so:

[btn addTarget:self action:@selector(buttonPress:) forControlEvents:UIControlEventTouchDown];
[btn addTarget:self action:@selector(buttonRelease:) forControlEvents:UIControlEventTouchUpInside];
[btn addTarget:self action:@selector(buttonRelease:) forControlEvents:UIControlEventTouchUpOutside];

NOTE1: Setting the CGAffineTransformMakeScale values to 1.0 does not keep them at their altered values (i.e., it does not multiply 1.1 by 1.0), but rather sets it back to the object's original scale.

NOTE2: Don't forget the colon : in the selector, as it allows the passing of the sender as a parameter to the receiving method. In this case, our methods receive a UIButton and would be declared as such in the interface (.h file).


Call

button.transform = CGAffineTransformMakeScale(1.1,1.1);

In button pressed handler.

Or if you want to scale with animation:

[UIView beginAnimations:@"ScaleButton" context:NULL];
[UIView setAnimationDuration: 0.5f];
button.transform = CGAffineTransformMakeScale(1.1,1.1);
[UIView commitAnimations];

Swift 5

To make it feel more like native UIButton behaviour I prefer to use touchesBegun and touchesEnded methods in a subclass:

class BaseButton: UIButton {
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        super.touchesBegan(touches, with: event)
        UIView.animate(withDuration: 0.3) {
            self.transform = CGAffineTransform(scaleX: 1.1, y: 1.1)
            self.titleLabel?.alpha = 0.7
        }
    }
    
    override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
        super.touchesEnded(touches, with: event)
        UIView.animate(withDuration: 0.3) {
            self.transform = .identity
            self.titleLabel?.alpha = 1
        }
    }
}

Usage

In your storyboard, just make your buttons inherit from BaseButton.


Slightly modified code from that of @ibm123 which avoids sudden resize issue.

- (IBAction) buttonTapAction:(UIButton *) sender {
[self animatePressedDown:sender duration:0.6 zoom:1.5];

}

- (void)animatePressedDown:(UIButton *) sender duration:(double) t zoom:(double) zoomX {
[UIView animateWithDuration:t delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
    sender.transform = CGAffineTransformMakeScale(zoomX,zoomX);
} completion:^(BOOL finished) {
    [UIView animateWithDuration:t delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
        sender.transform = CGAffineTransformMakeScale(1,1);
    } completion:nil];
}];

}