I am trying to change the color and image of a button when its pressed. This is what i have
- (IBAction)likeButtonTouched:(UIButton*)sender {
sender.imageView.image = [sender.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[sender setImage: [UIImage imageNamed:@"Like Filled"] forState:UIControlStateNormal];
[sender setTintColor:secondaryColor];
}
This code works in viewDidLoad but in this, the tint color isnt changed but the image is. Anyone know why?