StepSlider

StepSlider its custom implementation of slider such as UISlider for preset integer values.

Github星跟蹤圖

StepSlider

StepSlider its custom implementation of slider such as UISlider for preset values. Behind the scenes StepSlider manipulate integer indexes. Its based on drawing directlyon CAShapeLayer.

Usage

You can add StepSlider right from code with any of standard initialisers. Or you can add it directly on your storybord. Its fully IBDesignable and IBInspetable compatible.

StepSlider *slider = [[StepSlider alloc] initWithFrame:CGRectMake(10.f, 200.f, 300.f, 44.f)];
[slider setMaxCount:10];
[slider setIndex:2];
[self.view addSubview:slider];

StepSlider can be fully customised by any of this properties:

  • trackHeight
  • trackCircleRadius
  • sliderCircleRadius
  • dotsInteractionEnabled
  • trackColor
  • sliderCircleColor
  • sliderCircleImage

Supports haptic feedback on valueChanged:.

Labels

From version 1.0.0 StepSlider support labels near each circle on track.

slider.labels = @[@"Some string", @"another string", @"one more"];

slider.adjustLabel - set first and last label to exactly to frame left and right.

Images

For 1.2.0 and higher you can use images for sliderCircle and trackCircles. For trackCircles supported two states: normal and selected.

[self.sliderView setTrackCircleImage:[UIImage imageNamed:@"unselected_dot"] forState:UIControlStateNormal];
[self.sliderView setTrackCircleImage:[UIImage imageNamed:@"selected_dot"] forState:UIControlStateSelected];

Requirements

  • version 1.3.0 and above needs iOS 10.0+
  • version 1.2.1 supports iOS 7.0+

Installation

CocoaPods

To integrate StepSlider into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'StepSlider', '~> 1.3.0'

Then, run the following command:

$ pod install

Carthage

To integrate StepSlider into your Xcode project using Carthage, specify it in your Cartfile:

github "spromicky/StepSlider" ~> 1.3.0

Run carthage update to build the framework and drag the built StepSlider.framework into your Xcode project.

Manual Installation

Just copy StepSlider class to your project.

License

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

主要指標

概覽
名稱與所有者spromicky/StepSlider
主編程語言Objective-C
編程語言Objective-C (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-10-20 15:37:03
推送於2021-06-15 10:27:43
最后一次提交2021-06-15 13:27:42
發布數20
最新版本名稱1.8.0 (發布於 )
第一版名稱0.0.1 (發布於 )
用户参与
星數574
關注者數11
派生數108
提交數82
已啟用問題?
問題數45
打開的問題數6
拉請求數4
打開的拉請求數0
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?