setLabel(_:forSegment:)
Sets the label for the specified segment.
Declaration
func setLabel(_ label: String, forSegment segment: Int)Parameters
- label:
The label you want to display in the segment. If the width of the string is greater than the width of the segment, the string’s text is truncated during drawing.
- segment:
The index of the segment whose label you want to set. This method raises an exception (Rangeexception) if the index is out of bounds.
See Also
Configuring Individual Segments
label(forSegment:)setImage(_:forSegment:)image(forSegment:)setImageScaling(_:forSegment:)imageScaling(forSegment:)setWidth(_:forSegment:)width(forSegment:)setEnabled(_:forSegment:)isEnabled(forSegment:)setMenu(_:forSegment:)menu(forSegment:)setToolTip(_:forSegment:)toolTip(forSegment:)setTag(_:forSegment:)tag(forSegment:)