if you want fade out/fade in animation for the button i can replace you custom button with an UIImageview which has the same background image as you initial uibutton.This will be the first thing to to in the action of teh button.When the button is replaced with the uiview cou can apply fade out animation to UIImageview from initial backgorund image to new (selected version). When the animation ends, in the completion block begin another animation which fades out the selected iamge to normal background iamge.Then the second animation ends remove your uiimageview and add your button back.
//Declare your uiimageviews as ivars
UIImageView *imageViewnormal = [[UIimageView alloc] initWithImage:normalIamge];
UIImageView *imageViewhighlighted = [[UIimageView alloc] initWithImage:highlightImage];
In the action for UIControlEventTouchDown
of your button
// make your button invisible
yourbutton.alpha = 0;
//add to same rect 2 imageviews with initial and selected backgrounds of uibutton
imageViewnormal.alpha = 1;
imageViewhighlighted.alpha = 0;
[self.view addSubview:imageViewhighlighted];
[self.view addSubview:imageViewnormal];
// newImageViewWithInitialBackground needs to be inserted secondly and alpha value 1
// newImageViewWithSelectedBackground has alpha 0 and is behind newImageViewWithInitialBackground
[UIView animateWithDuration:0.3
animations:^
{
imageViewnormalalpha = 0;
imageViewhighlighted.alpha = 1;
}
completion:^(BOOL finished)
{
}];
In the action for UIControlEventTouchUpInside of your button
[UIView animateWithDuration:0.3
animations:^
{
imageViewnormal.alpha = 1;
imageViewhighlighted.alpha = 0;
}
completion:^(BOOL finished)
{
//Remove both of the uiimageviews aand make your button visible
[imageViewnormal removeFromSuperview];
[mageViewhighlighted removeFromSuperview];
yourbutton.alpha = 1;
}];