thumbRect(forBounds:trackRect:value:)
Returns the drawing rectangle for the slider’s thumb image.
Declaration
func thumbRect(forBounds bounds: CGRect, trackRect rect: CGRect, value: Float) -> CGRectParameters
- bounds:
The bounding rectangle of the slider.
- rect:
The drawing rectangle for the slider’s track, as returned by the Trackrect(forbounds:) method.
- value:
The current value of the slider.
Return Value
The computed drawing rectangle for the thumb image.
Discussion
You do not call this method directly. Instead, you override it when you want to customize the thumb image’s drawing rectangle, returning a different rectangle. The rectangle you return must reflect the size of your thumb image and its current position on the slider’s track.