I created a UISegmentedControl with two segments using the interface builder (from the storyboard), but I would like to program the text of the two segments. I want to do this because I use NSLocalizedString for all my buttons, shortcuts, titles, etc. I create all the materials in the interface builder, and then add the text programmatically. I managed to get each element to work this way, but I can't find a way to add text to my UISegmentedControl.
Is there any way to do this? I am trying to use the following, but since the segmented control is already created in the interface builder, it does not work.
[segmentedControl initWithItems:[NSArray arrayWithObjects:NSLocalizedString(@"Title 1", @"Title 1"),NSLocalizedString(@"Title 2", @"Title 2"), nil]];
Thank you so much
ios objective-c iphone ipad
user1015777 Mar 22 2018-12-12T00: 00Z
source share