Contents

setWidth(_:forSegmentAt:)

Sets the width of the segment at the index you specify.

Declaration

func setWidth(_ width: CGFloat, forSegmentAt segment: Int)

Parameters

  • width:

    A float value specifying the width of the segment. The default value is {0.0}, which tells UISegmentedControl to automatically size the segment.

  • 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.

See Also

Managing segment behavior and appearance