Having a segmented control with two UIButton and set the action to action:@selector(segmentedControl:) for each button.
- (IBAction)segmentedControl:(id)sender {
BOOL activateSecond = _firstTab.selected;
_firstTab.selected = !activateSecond;
_secondTab.selected = activateSecond;
}
The issue which still remains is how to solve if I’m tapping on the active button (now the active state jumps to the other one).
On top of my head, I think you could use tag property.
Set each button’s tag to a number.
Then when you receive a send in your segmentedControl method cast it to UIButton and check it’s tag value.