insertSegment(action:at:animated:)
Insert a segment with the action you specify at the given index.
Declaration
func insertSegment(action: UIAction, at segment: Int, animated: Bool)Parameters
Discussion
Segments prefer images over titles when the action contains both. Selecting a segment invokes the action’s UIActionHandler, as well as handlers for the valueChanged and primaryActionTriggered control events.
If a segment exists with the action’s identifier, this method updates the existing segment is if the index is the same or removes the segment if the index is different.