Class

UIStepper

A control used to increment or decrement a value.

Declaration

@interface UIStepper : UIControl

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

Topics

Configuring the Stepper

continuous

The continuous vs. noncontinuous state of the stepper.

autorepeat

The automatic vs. nonautomatic repeat state of the stepper.

wraps

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

minimumValue

The lowest possible numeric value for the stepper.

maximumValue

The highest possible numeric value for the stepper.

stepValue

The step, or increment, value for the stepper.

Accessing the Stepper’s Value

value

The numeric value of the stepper.

Customizing Appearance

tintColor

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

- backgroundImageForState:

Returns the background image associated with the specified control state.

- setBackgroundImage:forState:

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

- decrementImageForState:

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

- setDecrementImage:forState:

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

- dividerImageForLeftSegmentState:rightSegmentState:

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

- setDividerImage:forLeftSegmentState:rightSegmentState:

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

- incrementImageForState:

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

- setIncrementImage:forState:

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

Relationships

Inherits From

See Also

Controls

UIControl

The base class for controls, which are visual elements that convey a specific action or intention in response to user interactions.

UIButton

A control that executes your custom code in response to user interactions.

UIDatePicker

A control used for the inputting of date and time values.

UIPageControl

A control that displays a horizontal series of dots, each of which corresponds to a page in the app’s document or other data-model entity.

UISegmentedControl

A horizontal control made of multiple segments, each segment functioning as a discrete button.

UISlider

A control used to select a single value from a continuous range of values.

UISwitch

A control that offers a binary choice, such as On/Off.