Slider
@available(iOS 9.0, *)
@IBDesignable
@objcMembers
@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
@IBInspectable open var thumbTintColor: UIColor? { get set }
-
The color used to tint the background color of the thumb.
Declaration
Swift
@IBInspectable open var thumbBackgroundColor: UIColor { get set }
-
The color used to tint the filled track. If no color is set, the default
tintColor
will be used.Declaration
Swift
@IBInspectable open var filledTrackColor: UIColor? { get set }
-
The color used to tint the unfilled track.
Declaration
Swift
@IBInspectable open var unfilledTrackColor: UIColor { get set }
-
Contains the minimum value of the receiver.
Declaration
Swift
@IBInspectable open var minimumValue: CGFloat { get set }
-
Contains the maximum value of the receiver.
Declaration
Swift
@IBInspectable open var maximumValue: CGFloat { get set }
-
Contains the neutral value of the receiver.
Declaration
Swift
@IBInspectable open var neutralValue: CGFloat { get set }
-
The pan gesture recognizer that is used to recognize user interaction in the slider.
Declaration
Swift
open let panGestureRecognizer: UIPanGestureRecognizer
-
Contains the receiver’s current value.
Declaration
Swift
@IBInspectable open var value: CGFloat { get set }
-
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.
-
Called by the gesture recognizer detecting the pan gesture. You should not call this method directly.
Declaration
Swift
open func beginTracking(with panGestureRecognizer: UIPanGestureRecognizer) -> Bool
Parameters
panGestureRecognizer
The pan gesture recognizer which began tracking.
Return Value
Whether to continue tracking or not.
-
Called by the gesture recognizer detecting the pan gesture. You should not call this method directly.
Declaration
Swift
open func continueTracking(with panGestureRecognizer: UIPanGestureRecognizer)
Parameters
panGestureRecognizer
The pan gesture recognizer that continues tracking.
-
Called by the gesture recognizer detecting the pan gesture. You should not call this method directly.
Declaration
Swift
open func endTracking(with panGestureRecognizer: UIPanGestureRecognizer)
Parameters
panGestureRecognizer
The pan gesture recognizer that ended tracking.