Coder Social home page Coder Social logo

vivalalova / rangesliderview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nsomar/rangesliderview

0.0 3.0 2.0 172 KB

RangeSliderView provide an easy to use range selection view.

License: MIT License

Ruby 0.61% Swift 74.26% Objective-C 16.00% Shell 8.91% Makefile 0.22%

rangesliderview's Introduction

RangeSliderView

CI Status Version License Platform



RangeSliderView is a NSControl/UIControl subclass that provides an easy control to select a range.

Features

  • Cross platform; works on the iOS and MacOSX.
  • Customisable Knob and Progress colors.
  • @IBDesignable and @IBInspectable

Installation

RangeSliderView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RangeSliderView"

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Using Interface builder

You can add RangeSliderView in your view using Interface builder by dragging a view and set RangeSliderView as the custom view class.

You can add an action using normal target action.

RangeSliderView contain inspectable properties, to change it's properties, edit the inspectable values in Interface Builder.

Inspectable

Using code

Create a RangeSliderView and add it as a subview

let rangeSliderView = RangeSliderView(frame: CGRect(x: 10, y: 10, width: 200, height: 50))
self.view.addSubview(rangeSliderView)

To add actions, you can either use Target/Action or blocks. To use target/action:

On Mac

rangeSliderView.target = self
rangeSliderView.action = "valueChanged:"

On iOS

rangeSliderView.addTarget(self, action: "valueChanged:", forControlEvents: .ValueChanged)

For block action callbacks use the following

rangeSliderView.selectedValuesChanged = { min, max in
}

Customisation

The following are customisable properties of the RangeSliderView:

sliderKnobColor Sets the Knob background color (Defaults to white)

sliderKnobHighligtedColor Sets the Knob highlight color (Defaults to light grey)

sliderKnobBorderColor Sets the Knob border color (Defaults to grey)

sliderProgressFilledColor Sets the slider progress filled color (Defaults to blue)

sliderProgressEmptyColor Sets the slider progress empty color (Defaults to grey)

screenshots

Mac:

Normal colors Fancy colors

iOS:

Normal colors Fancy colors

Author

Omar Abdelhafith, [email protected]

License

RangeSliderView is available under the MIT license. See the LICENSE file for more info.

rangesliderview's People

Contributors

nsomar avatar

Watchers

James Cloos avatar Brian Fang avatar Lova 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.