MrMins MrMins - 2 months ago 16
iOS Question

Fill programmatically UISegmentedControl using swift

Is possible fill the values of a

UISegmentedControl
programmatically using swift?

Answer
let segmentedControl = UISegmentedControl()
segmentedControl.insertSegment(withTitle: "Title", at: 0, animated: true)
segmentedControl.setTitle("Another Title", forSegmentAt: 0)