• Stars
    star
    186
  • Rank 207,316 (Top 5 %)
  • Language
    Objective-C
  • License
    Other
  • Created over 9 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A custom reusable slider control with 2 thumbs (range slider).

MARKRangeSlider

Version License Platform

A custom reusable slider control with 2 thumbs (range slider). Values range is between minimumValue and maximumValue (from 0 to 1 by default). The left thumb isn't able to go on the right side of the right thumb, and vice versa. Control enables multitouch (to use 2 fingers at 2 thumbs at the same time).

Please check Demo project for a basic example on how to use MARKRangeSlider.

Demo

Alt text

Available control properties

  • minimumValue - the minimum value of the slider's range (readonly)
  • maximumValue - the maximum value of the slider's range (readonly)
  • leftValue - the value of the left thumb (readonly)
  • rightValue - the value of the right thumb (readonly)
  • minimumDistance - the distance between 2 thumbs (thumbs can't be closer to each other than this distance)
  • pushable - allows the user to push both controls
  • disableOverlapping - disables the overlaping of thumb controls
  • sendInstantUpdates - allows the user to select between instant updates and after completing drag of thumb

Available control methods

  • (void)setMinValue:(CGFloat)minValue maxValue:(CGFloat)maxValue
  • (void)setLeftValue:(CGFloat)leftValue rightValue:(CGFloat)rightValue

Available styling properties

Images are customizable, default ones are used when no image is provided.

  • trackImage - track background image
  • rangeImage - range background image
  • leftThumbImage - left thumb image
  • rightThumbImage - right thumb image

Usage

In your View Controller

- (void)viewDidLoad {
    // ...
    self.rangeSlider = [[MARKRangeSlider alloc] initWithFrame:CGRectZero];
    [self.rangeSlider addTarget:self
                         action:@selector(rangeSliderValueDidChange:)
               forControlEvents:UIControlEventValueChanged];

    [self.rangeSlider setMinValue:0.0 maxValue:1.0];
    [self.rangeSlider setLeftValue:0.2 rightValue:0.7];

    self.rangeSlider.minimumDistance = 0.2;

    [self.view addSubview:self.rangeSlider];
    // ...
}

- (void)rangeSliderValueDidChange:(MARKRangeSlider *)slider {
    NSLog(@"%0.2f - %0.2f", slider.leftValue, slider.rightValue);
}

Installation

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

pod 'MARKRangeSlider'

Author

Vadym Markov, [email protected]

License

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

More Repositories

1

Fakery

👽 Swift fake data generator
Swift
1,786
star
2

Beethoven

🎸 A maestro of pitch detection.
Swift
810
star
3

Malibu

🏄 Malibu is a networking library built on promises
Swift
414
star
4

When

⏰ A lightweight implementation of Promises in Swift
Swift
264
star
5

Pitchy

🎼 A simple way to get a music pitch from a frequency.
Swift
163
star
6

Fashion

💅 Fashion accessories and beauty tools to share and reuse UI styles in a Swifty way
Swift
132
star
7

RetroProgress

💈 Retro looking progress bar straight from the 90s
Swift
83
star
8

PinFloyd

MapKit annotations clustering for iOS
Swift
27
star
9

MARKCircularSlider

An easy-to-use circular slider
Objective-C
25
star
10

TVShowroom

An app that demonstrates standard tvOS interface elements.
Swift
19
star
11

Rexy

🐲 POSIX Regular Expressions in Swift
Swift
16
star
12

reviewery-mobile

iOS application to rate songs in Spotify playlists
JavaScript
16
star
13

geobot

A simple chat bot built using Wit.ai and Vapor Swift web framework.
Swift
15
star
14

Kontena

IOC container in Swift
Swift
6
star
15

MARKTempoMeter

A simple tool to determine the BPM (beats per minute).
Objective-C
6
star
16

novel-cli

Novel CMS command line interface.
Swift
4
star
17

TypeHelper

A simple function for getting the name of the non optional type in Swift.
Swift
4
star
18

SpeechNotes

Speech-To-Text iOS demo application
Swift
4
star
19

Mentions

Swift
3
star
20

reviewery-server

Node.js server for Reviewery iOS application.
JavaScript
3
star
21

novel-template

A basic template for creating a new Novel Swift CMS application.
CSS
2
star
22

novel-demo

Demo for Novel Swift CMS.
JavaScript
2
star
23

UIImage-MARKColorizer

UIImage category for image colorizing
Objective-C
2
star
24

UIImageView-MARKColorizer

UIImageView category for image colorizing
Objective-C
2
star
25

vadymmarkov.github.io

▼ A simple portfolio static website built in Jekyll
HTML
2
star
26

Limb

¯\_(ツ)_/¯
Shell
1
star