Contents

trackRect(forBounds:)

Returns the drawing rectangle for the slider’s track.

Declaration

func trackRect(forBounds bounds: CGRect) -> CGRect

Parameters

  • bounds:

    The bounding rectangle of the slider.

Return Value

The computed drawing rectangle for the track. This rectangle corresponds to the entire length of the track between the minimum and maximum value images.

Discussion

You do not call this method directly. Instead, you override it when you want to customize the track rectangle, returning a different rectangle. The returned rectangle is used to scale the track and thumb images during drawing.

See Also

Overrides for subclasses