Class

UIStepper

A stepper control provides a user interface for incrementing or decrementing a value. A stepper displays two buttons, one with a minus (“–”) symbol and one with a plus (“+”) symbol.

Overview

If you set stepper behavior to “autorepeat” (which is the default), pressing and holding one of its buttons increments or decrements the stepper’s value repeatedly. The rate of change depends on how long the user continues pressing the control.

The maximum value must be greater than or equal to the minimum value. If you set a maximum or minimum value that would make break this invariant, both values are set to the new value. For example, if the minimum value is 200 and you set a maximum value of 100, then both the minimum and maximum become 200.

For information about basic view behaviors, see View Programming Guide for iOS.

For more information about appearance and behavior configuration, see Steppers.

Symbols

Configuring the Stepper

var isContinuous: Bool

The continuous vs. noncontinuous state of the stepper.

var autorepeat: Bool

The automatic vs. nonautomatic repeat state of the stepper.

var wraps: Bool

The wrap vs. no-wrap state of the stepper.

var minimumValue: Double

The lowest possible numeric value for the stepper.

var maximumValue: Double

The highest possible numeric value for the stepper.

var stepValue: Double

The step, or increment, value for the stepper.

Accessing the Stepper’s Value

var value: Double

The numeric value of the stepper.

Customizing Appearance

var tintColor: UIColor!

The tint color to apply to key elements in the stepper.

func backgroundImage(for: UIControlState)

Returns the background image associated with the specified control state.

func setBackgroundImage(UIImage?, for: UIControlState)

Sets the background image for the control when it is in the specified state.

func decrementImage(for: UIControlState)

Returns the image used for the decrement glyph of the control.

func setDecrementImage(UIImage?, for: UIControlState)

Sets the image to use for the decrement glyph of the control.

func dividerImage(forLeftSegmentState: UIControlState, rightSegmentState: UIControlState)

Returns the divider image for the given combination of left and right states.

func setDividerImage(UIImage?, forLeftSegmentState: UIControlState, rightSegmentState: UIControlState)

Sets the image to use for the given combination of left and right states.

func incrementImage(for: UIControlState)

Returns the image used for the increment glyph of the control.

func setIncrementImage(UIImage?, for: UIControlState)

Sets the image to use for the increment glyph of the control

Relationships

Inherits From