How can I get the text value of a segment in a UISegmentedControl?
Objective-C
NSString *title = [segment titleForSegmentAtIndex:segment.selectedSegmentIndex];
Swift:
let title = segment.titleForSegment(at: segment.selectedSegmentIndex)
[segmentedControl titleForSegmentAtIndex:int];
For the current selected index
[segmentedControl titleForSegmentAtIndex:[segmentedControl 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