insertSegment(with:at:animated:)
Inserts a segment at the position you specify and gives it an image as content.
Declaration
func insertSegment(with image: UIImage?, at segment: Int, animated: Bool)Parameters
- image:
An image object to use as the content of the segment.
- segment:
An index number identifying a segment in the control.
segmentmust be a number in the range 0 to the number of segments (Numberofsegments) inclusive; the segmented control pins values exceeding this upper range to the last segment.The segmented control inserts the new segment immediately before the designated one.
- animated:
True if the insertion of the new segment must animate; otherwise, False.