I've noticed that if I do something like this
[self setTitle:@"Follow" forState:UIControlStateNormal];
[self setTitle:@"Following" forState:UIControlStateSelected];
The button will start off with "Follow". I press it, and when I release my finger (touch up event) it changes to "Following". That's great. However, when It's now selected and I press it, it immediately changes to "Follow" before I release my finger (on a touch down event). I want to change when I release my finger (touch up event). How do I do this? I am using UIControlStates for a UIButton's title, images, and title color.
Below is my event handler:
- (void)followButtonAction:(UIButton *)button
{
button.selected = !button.selected;
}
and I set it as so:
[self.followButton addTarget:self action:@selector(followButtonAction:) forControlEvents:UIControlEventTouchUpInside];