RangeUISlider

@IBDesignable
open class RangeUISlider : UIView, ProgrammaticKnobChangeDelegate, RangeUpdaterDelegate

A custom slider with two knobs that allow the user to select a range. RangeUISlider has been created using Autolayout. It is an IBDesignable UIVIew and all its properties are IBInspectable. RangeUISlider support RTL (right to left) languages automatically out of the box.

  • Slider identifier.

    Declaration

    Swift

    @IBInspectable
    public var identifier: Int
  • Step increment value. If different from 0 RangeUISlider will let the user drag by step increment.

    Declaration

    Swift

    @IBInspectable
    public var stepIncrement: CGFloat
  • Show knobs labels.

    Declaration

    Swift

    @IBInspectable
    public var showKnobsLabels: Bool { get set }
  • Show knobs labels at the top or at the bottom of knobs.

    Declaration

    Swift

    @IBInspectable
    public var knobsLabelTopPosition: Bool { get set }
  • Default left knob starting value.

    Declaration

    Swift

    @IBInspectable
    public var defaultValueLeftKnob: CGFloat { get set }
  • Default right knob starting value.

    Declaration

    Swift

    @IBInspectable
    public var defaultValueRightKnob: CGFloat { get set }
  • Scale minimum value.

    Declaration

    Swift

    @IBInspectable
    public var scaleMinValue: CGFloat { get set }
  • Scale maximum value.

    Declaration

    Swift

    @IBInspectable
    public var scaleMaxValue: CGFloat { get set }
  • Selected range color.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedColor: UIColor { get set }
  • Background range selected strechable image.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedBackgroundImage: UIImage? { get set }
  • Background range selected top edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedBackgroundEdgeInsetTop: CGFloat { get set }
  • Background range selected left edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedBackgroundEdgeInsetLeft: CGFloat { get set }
  • Background range selected bottom edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedBackgroundEdgeInsetBottom: CGFloat { get set }
  • Background range selected right edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedBackgroundEdgeInsetRight: CGFloat { get set }
  • Gradient color 1 for range selected.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedGradientColor1: UIColor? { get set }
  • Gradient color 2 for range selected.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedGradientColor2: UIColor? { get set }
  • Gradient start point for selected range.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedGradientStartPoint: CGPoint { get set }
  • Gradient end point for selected range.

    Declaration

    Swift

    @IBInspectable
    public var rangeSelectedGradientEndPoint: CGPoint { get set }
  • Not selected range color.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedColor: UIColor { get set }
  • Background range selected strechable image.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedBackgroundImage: UIImage? { get set }
  • Background range selected top edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedBackgroundEdgeInsetTop: CGFloat { get set }
  • Background range selected left edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedBackgroundEdgeInsetLeft: CGFloat { get set }
  • Background range selected bottom edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedBackgroundEdgeInsetBottom: CGFloat { get set }
  • Background range selected right edge insect for background image.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedBackgroundEdgeInsetRight: CGFloat { get set }
  • Gradient color 1 for range not selected.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedGradientColor1: UIColor? { get set }
  • Gradient color 2 for range not selected.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedGradientColor2: UIColor? { get set }
  • Gradient start point for not selected range.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedGradientStartPoint: CGPoint { get set }
  • Gradient end point for not selected range.

    Declaration

    Swift

    @IBInspectable
    public var rangeNotSelectedGradientEndPoint: CGPoint { get set }
  • Left knob width.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobWidth: CGFloat { get set }
  • Left knob height.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobHeight: CGFloat { get set }
  • Left knob corners.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobCorners: CGFloat { get set }
  • Left knob image.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobImage: UIImage? { get set }
  • Left knob color.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobColor: UIColor { get set }
  • Left knob shadow opacity.

    Declaration

    Swift

    @IBInspectable
    public var leftShadowOpacity: Float { get set }
  • Left knob shadow color.

    Declaration

    Swift

    @IBInspectable
    public var leftShadowColor: UIColor { get set }
  • Left knob shadow offset.

    Declaration

    Swift

    @IBInspectable
    public var leftShadowOffset: CGSize { get set }
  • Left knob shadow radius.

    Declaration

    Swift

    @IBInspectable
    public var leftShadowRadius: CGFloat { get set }
  • Gradient color 1 for range not selected.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobGradientColor1: UIColor? { get set }
  • Gradient color 2 for range not selected.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobGradientColor2: UIColor? { get set }
  • Gradient start point for not selected range.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobGradientStartPoint: CGPoint { get set }
  • Gradient end point for not selected range.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobGradientEndPoint: CGPoint { get set }
  • Left knob border width.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobBorderWidth: CGFloat { get set }
  • Left knob border color.

    Declaration

    Swift

    @IBInspectable
    public var leftKnobBorderColor: UIColor { get set }
  • Right knob width.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobWidth: CGFloat { get set }
  • Right knob height.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobHeight: CGFloat { get set }
  • Right knob corners.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobCorners: CGFloat { get set }
  • Right knob image.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobImage: UIImage? { get set }
  • Right knob color.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobColor: UIColor { get set }
  • Right knob shadow opacity.

    Declaration

    Swift

    @IBInspectable
    public var rightShadowOpacity: Float { get set }
  • Right knob shadow color.

    Declaration

    Swift

    @IBInspectable
    public var rightShadowColor: UIColor { get set }
  • Right knob shadow offset.

    Declaration

    Swift

    @IBInspectable
    public var rightShadowOffset: CGSize { get set }
  • Right knob shadow radius.

    Declaration

    Swift

    @IBInspectable
    public var rightShadowRadius: CGFloat { get set }
  • Gradient color 1 for range not selected.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobGradientColor1: UIColor? { get set }
  • Gradient color 2 for range not selected.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobGradientColor2: UIColor? { get set }
  • Gradient start point for not selected range.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobGradientStartPoint: CGPoint { get set }
  • Gradient end point for not selected range.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobGradientEndPoint: CGPoint { get set }
  • Right knob border width.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobBorderWidth: CGFloat { get set }
  • Right knob border color.

    Declaration

    Swift

    @IBInspectable
    public var rightKnobBorderColor: UIColor { get set }
  • Knobs labels font size.

    Declaration

    Swift

    @IBInspectable
    public var knobsLabelFontSize: CGFloat { get set }
  • Knobs label font color.

    Declaration

    Swift

    @IBInspectable
    public var knobsLabelFontColor: UIColor { get set }
  • Knobs labels number of decimal.

    Declaration

    Swift

    @IBInspectable
    public var knobsLabelNumberOfDecimal: Int
  • Bar height.

    Declaration

    Swift

    @IBInspectable
    public var barHeight: CGFloat { get set }
  • Bar leading offset.

    Declaration

    Swift

    @IBInspectable
    public var barLeading: CGFloat { get set }
  • Bar trailing offset.

    Declaration

    Swift

    @IBInspectable
    public var barTrailing: CGFloat { get set }
  • Bar corners.

    Declaration

    Swift

    @IBInspectable
    public var barCorners: CGFloat { get set }
  • Bar shadow opacity.

    Declaration

    Swift

    @IBInspectable
    public var barShadowOpacity: Float { get set }
  • Bar shadow color.

    Declaration

    Swift

    @IBInspectable
    public var barShadowColor: UIColor { get set }
  • Bar shadow offset.

    Declaration

    Swift

    @IBInspectable
    public var barShadowOffset: CGSize { get set }
  • Bar shadow radius.

    Declaration

    Swift

    @IBInspectable
    public var barShadowRadius: CGFloat { get set }
  • Bar border color.

    Declaration

    Swift

    @IBInspectable
    public var barBorderWidth: CGFloat { get set }
  • Bar border color.

    Declaration

    Swift

    @IBInspectable
    public var barBorderColor: UIColor { get set }
  • Slider delegate.

    Declaration

    Swift

    public weak var delegate: RangeUISliderDelegate?
  • The UI components of RangeUISlider: knobs, bar, and prosgress views.

    Declaration

    Swift

    public let components: RangeUISliderComponents

init

  • Standard init using coder.

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)

    Parameters

    aDecoder

    the decoder used to init the sliders.

  • Standard init using a CGRect.

    Declaration

    Swift

    override public init(frame: CGRect)

    Parameters

    frame

    the frame used to init the slider.

views lifecycle

  • Prepare RangeUISlider to be drawn in Interface Builder.

    Declaration

    Swift

    open override func prepareForInterfaceBuilder()
  • Custom layout subviews to set the default values for the know of RangeUISlider

    Declaration

    Swift

    public override func layoutSubviews()

programmatic api

  • Change the value of the left knob programmatically.

    Declaration

    Swift

    public func changeLeftKnob(value: CGFloat)

    Parameters

    value

    the new value to be assigned to the left knob

  • Change the value of the right knob programmatically.

    Declaration

    Swift

    public func changeRightKnob(value: CGFloat)

    Parameters

    value

    the new value to be assigned to the right knob