Instance Method

setBackgroundImage(_:for:)

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

Declaration

func setBackgroundImage(_ image: UIImage?, for state: UIControl.State)

Parameters

image

The background image to use for the specified state.

state

The control state in which you want to display the image.

Discussion

For good results, image must be a stretchable image.

See Also

Customizing Appearance

var tintColor: UIColor!

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

func backgroundImage(for: UIControl.State) -> UIImage?

Returns the background image associated with the specified control state.

func decrementImage(for: UIControl.State) -> UIImage?

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

func setDecrementImage(UIImage?, for: UIControl.State)

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

func dividerImage(forLeftSegmentState: UIControl.State, rightSegmentState: UIControl.State) -> UIImage?

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

func setDividerImage(UIImage?, forLeftSegmentState: UIControl.State, rightSegmentState: UIControl.State)

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

func incrementImage(for: UIControl.State) -> UIImage?

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

func setIncrementImage(UIImage?, for: UIControl.State)

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