Slider
@objc(PESDKSlider) open class Slider: UIControl
A Slider object is a visual control used to select a single value from a continuous range of values. Sliders are always displayed as horizontal bars. An indicator, or thumb, notes the current value of the slider and can be moved by the user to change the setting. A vertical indicator, or neutral point, notes the default, unchanged value of the slider.
-
The color used to tint the thumb image. If no color is set, the default
tintColor
will be used.Declaration
Swift
open var thumbTintColor: UIColor?
-
The color used to tint the background color of the thumb.
Declaration
Swift
open var thumbBackgroundColor: UIColor = UIColor(red: 0.11, green: 0.11, blue: 0.11, alpha: 1.00)
-
The color used to tint the filled track. If no color is set, the default
tintColor
will be used.Declaration
Swift
open var filledTrackColor: UIColor?
-
The color used to tint the unfilled track.
Declaration
Swift
open var unfilledTrackColor: UIColor = UIColor(red: 0.64, green: 0.64, blue: 0.64, alpha: 1.00)
-
Contains the minimum value of the receiver.
Declaration
Swift
open var minimumValue: CGFloat
-
Contains the maximum value of the receiver.
Declaration
Swift
open var maximumValue: CGFloat
-
Contains the neutral value of the receiver.
Declaration
Swift
open var neutralValue: CGFloat
-
Contains the receiver’s current value.
Declaration
Swift
open var value: CGFloat
-
Returns the drawing rectangle for the slider’s track.
Declaration
Swift
open func trackRects(for bounds: CGRect) -> (CGRect, CGRect)
Parameters
bounds
The bounding rectangle of the receiver.
Return Value
The computed drawing rectangle for the track. This rectangle corresponds to the entire length of the track between the minimum and maximum values.
-
Returns the drawing rectangle for the slider’s thumb image.
Declaration
Swift
open func thumbRect(for bounds: CGRect, value: CGFloat) -> CGRect
Parameters
bounds
The bounding rectangle of the receiver.
value
The current value of the slider.
Return Value
The computed drawing rectangle for the thumb image.