Giter VIP home page Giter VIP logo

aorangeslider's Introduction

AORangeSlider

Screenshot gif

AORangeSlider is a custom UISlider with two handler to pick a minimum and maximum range. Inspired by https://github.com/muZZkat/NMRangeSlider

#Adding AORangeSlider to your project CocoaPods CocoaPods is the recommended way to add AORangeSlider to your project. Add the following line to your Podfile:

pod 'AORangeSlider', '~> 1.0'

Usage

let rangeSlider = AORangeSlider(frame: frame)
view.addSubView(rangeSlider)

If you want to call a method only when touch ends

rangeSlider.changeValueContinuously = false;
rangeSlider.addTarget(self, action: #selector(sliderValueChanged(sender:)), for: .valueChanged)

else if you want to call a method whenever the value changes, no matter by code or by touch,

rangeSlider.valuesChangedHandler = {
	//write your code here, and pay attention to Circular Reference.
}

Configuration

  • minimumValue : The minimum possible value of the range
  • maximumValue : The maximum possible value of the range
  • lowHandleImageNormal: The image of low thumb
  • highHandleImageNormal: The image of high thumb
  • lowValue: set low value programmatically
  • highValue: set high value programmatically
  • func setValue(low: Double, high: Double, animated: Bool) set values animated
  • stepValue: move animatedly to a stepValue when touch ends
  • stepValueContinuously: If true, the thumb will not move until it hit a new step

aorangeslider's People

Contributors

andy1984 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.