Contents

selectedSegmentIndex

The index number that identifies the selected segment that the user last touched.

Declaration

var selectedSegmentIndex: Int { get set }

Discussion

The default value is noSegment (no segment selected) until the user touches a segment. Set this property to -1 to turn off the current selection. UISegmentedControl ignores this property when isMomentary is true. When the user touches a segment to change the selection, the system generates the control event valueChanged. If you set up the segmented control to respond to this control event, it sends an action message to its target.

See Also

Managing segments