Instance Method

titleForSegment(at:)

Returns the title of the specified segment.

Declaration

func titleForSegment(at segment: Int) -> String?

Parameters

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; values exceeding this upper range are pinned to it.

Return Value

Returns the string (title) assigned to the receiver as content. If no title has been set, it returns nil.

See Also

Managing Segment Content

func setImage(UIImage?, forSegmentAt: Int)

Sets the content of a segment to a given image.

func imageForSegment(at: Int) -> UIImage?

Returns the image for a specific segment

func setTitle(String?, forSegmentAt: Int)

Sets the title of a segment.