I want to be able to use a segmented control, but I don't know how to get the value for which one was picked. I want to know so I can use a boolean value to determine between the two that were picked
Add method for segment using
[YourSegment addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
- (IBAction)segmentAction:(UISegmentedControl *)sender
{
NSString * theTitle = [sender titleForSegmentAtIndex:sender.selectedSegmentIndex]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With