Contents

setTitle(_:forSegmentAt:)

Sets the title of a segment.

Declaration

func setTitle(_ title: String?, forSegmentAt segment: Int)

Parameters

  • title:

    A string to display in the segment as its title.

  • segment:

    An index number identifying a segment in the control. It must be a number between 0 and the number of segments (Numberofsegments) minus 1; the segmented control pins values exceeding this upper range to the last segment.

Discussion

A segment can have only an image or a title; it can’t have both. There’s no default title.

See Also

Managing segment content