Latest 0.1
Homepage https://github.com/jaichaudhry/ScrollableSlider
License MIT
Platforms ios 9.0, requires ARC
Authors

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

Latest podspec

{
    "name": "ScrollableSlider",
    "version": "0.1",
    "summary": "This podspec can be used to extract the scrollabeSlider project.",
    "description": "This pod is used for creating a scrollable slider.",
    "homepage": "https://github.com/jaichaudhry/ScrollableSlider",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "jaichaudhry": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/jaichaudhry/ScrollableSlider.git",
        "tag": "0.1"
    },
    "source_files": "scrollableSlider/**/*.{h,m}",
    "resources": "scrollableSlider/**/*.png",
    "requires_arc": true
}

Pin It on Pinterest

Share This