In this iOS app, with UIKit in Swift, I create a UISegmentedControl in stroryboard.
I define the text for each segmentTitles in IB ,and need to localise.
I have tried in the main.xxx files
"id.segmentTitles" = ["a", "b", "c", "d", "e"];
to no avail.
I understand this is a very very old issue that UISegmentedControl are not localized from stroryboard:
https://stackoverflow.com/questions/12884751/uisegmentedcontrol-and-localization
I tried to use a similar approach as for UITextView (which are not either localized) helpTextView.text = NSLocalizedString("id.text", tableName: "Main", comment: "helpTextView")
But cannot make it.
I found a work around, by localising in code:
let seg0 = NSLocalizedString("a", comment: "Segment")
segmentedControl.setTitle(seg0, forSegmentAt: 0)
However, I get error messages in log unless I clear the segment titles in IB:
ERROR: id.segmentTitles[0] not found in table Main of bundle CFBundle 0x600003b101c0
Is there a solution to this ?