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; the segmented control pins values exceeding this upper range to the last segment.
Return Value
Returns the string (title) assigned to the receiver as content. If there is no title, it returns nil.