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. This property supports being set via aUIAppearance
proxy.Declaration
Swift
@IBInspectable open dynamic var thumbTintColor: UIColor? { get set }
-
The color used to tint the background color of the thumb. This property supports being set via a
UIAppearance
proxy.Declaration
Swift
@IBInspectable open dynamic var thumbBackgroundColor: UIColor { get set }
-
The color used to tint the filled track. If no color is set, the default
tintColor
will be used. This property supports being set via aUIAppearance
proxy.Declaration
Swift
@IBInspectable open dynamic var filledTrackColor: UIColor? { get set }
-
The color used to tint the unfilled track. This property supports being set via a
UIAppearance
proxy.Declaration
Swift
@IBInspectable open dynamic var unfilledTrackColor: UIColor { get set }
-
The height of the unfilled and filled track. This property supports being set via a
UIAppearance
proxy.Declaration
Swift
open dynamic var trackHeight: CGFloat { get set }
-
The corner radius of the unfilled and filled track. This property supports being set via a
UIAppearance
proxy.Declaration
Swift
open dynamic var trackCornerRadius: CGFloat { get set }
-
The size of the
thumbView
. This property supports being set via aUIAppearance
proxy.Declaration
Swift
open dynamic var thumbSize: CGSize { 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
public 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.
-
The view that is displaying the thumb.
Declaration
Swift
open var thumbView: UIImageView?
-
The left track for unfilled state.
Declaration
Swift
open var leftUnfilledTrackView: UIView?
-
The right track for unfilled state.
Declaration
Swift
open var rightUnfilledTrackView: UIView?
-
The track for the filled state.
Declaration
Swift
open var filledTrackView: UIView?
-
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.