Set the other image as the one for the UIControlStateSelected
and then when the button is tapped set the button to selected
= YES
, this will then change the image.
_addToFavouritesButton = [cell addFavouriteButton];
[_addToFavouritesButton addTarget:_thisController action:@selector(addToFavouritesButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
[_addToFavouritesButton setImage:blackHeart forState:UIControlStateSelected];
- (void)addToFavouritesButtonTapped:(UIButton *)sender
{
NSLog(@"add to favourites button tapped");
sender.selected = YES;
}