Instance Method

setContentOffset(_:forSegmentAt:)

Adjusts the offset for drawing the content (image or text) of the specified segment.

Declaration

func setContentOffset(_ offset: CGSize, forSegmentAt segment: Int)

Parameters

offset

The offset (specified as a CGSize type) from the origin of the segment at which to draw the segment’s content. The default offset is (0,0).

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.

See Also

Managing Segment Behavior and Appearance

var isMomentary: Bool

A Boolean value that determines whether segments in the receiver show selected state.

func setEnabled(Bool, forSegmentAt: Int)

Enables the specified segment.

func isEnabledForSegment(at: Int) -> Bool

Returns whether the indicated segment is enabled.

func contentOffsetForSegment(at: Int) -> CGSize

Returns the offset for drawing the content (image or text) of the specified segment.

func setWidth(CGFloat, forSegmentAt: Int)

Sets the width of the specified segment of the receiver.

func widthForSegment(at: Int) -> CGFloat

Returns the width of the indicated segment of the receiver.

var apportionsSegmentWidthsByContent: Bool

Indicates whether the control attempts to adjust segment widths based on their content widths.