GithubHelp home page GithubHelp logo

jaichaudhry / scrollableslider Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 33 KB

License: MIT License

Objective-C 63.49% Ruby 10.46% Shell 26.05%
objective-c slider scrollable scaled uislider customizable ios iosdev

scrollableslider's Introduction

ScrollableSlider

This can be used to create a scrollable slider which indicates the current values just like a Scale i.e. representing the values using ticks.

Install

Just add the following line to your podfile.

pod 'ScrollabeSlider'

Add it in your project easily

First import the scrollable slider in your project.

#import <ScrollableSlider/JCScrollableSlider.h>

Then configure it as follow

// Initialize the slider config first. The minimum and maximum are required values for the slider to be setup properly. You can check other customizable properties available in JCScrollableSliderConfig.
JCScrollableSliderConfig *sliderConfig = [[JCScrollableSliderConfig alloc] init];
sliderConfig.minValue = -4;
sliderConfig.maxValue = 4;

// Initialize the slider with above created configuration.
JCScrollableSlider *slider = [[JCScrollableSlider alloc] initWithSliderConfig:sliderConfig];
// Add the frame for your slider
slider.frame = CGRectMake(0, 0, 375, 50);
// Add it to your controller 
[self.view addSubview:slider];

You can also set the delegate for the slider to look for the changes happening to the values of slider. Your class would need to follow JCScrollableSliderDelegate protocol

slider.delegate = self

Now you can implement the following methods in your project

- (void)scrollableSlider:(JCScrollableSlider *)slider didSelectValue:(CGFloat)value {
    // Use this method to look for the updated values on scroll of slider.
}

- (void)scrollableSliderDidStopUpdating:(JCScrollableSlider *)slider {
    // Use this method to know when the slider stops updating.
}

- (void)scrollableSliderDidStartUpdating:(JCScrollableSlider *)slider {
    // Use this method to know when the slider starts updating values.
}

Preview

Your slider would look something like following after integration.

scrollableslider's People

Contributors

jaichaudhry 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.