You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
slider.outerTrackColor=.lightGray // outside of first and last thumbs
Vertical / horizontal orientation
slider.orientation=.horizontal // default is .verticalslider.isVertical=false // same effect, but accessible from Interface Builder
Value labels
slider.valueLabelPosition=.left // .notAnAttribute = don't show labelsslider.valueLabelAlternatePosition=true // alternate left and right positions (false by default)slider.isValueLabelRelative=true // show differences between thumbs instead of absolute valuesslider.valueLabelFormatter.positiveSuffix=" 𝞵s"slider.valueLabelColor=.greenslider.valueLabelFont= someFont
slider.snapStepSize=0.5 // default is 0.0, i.e. don't snapslider.snapValues=[1,2,4,8] // specify specific snap values instead uniform stepsslider.isHapticSnap=false // default is true, i.e. generate haptic feedback when sliding over snap valuesslider.snapImage=UIImage(systemName:"circle.fill") // default: no image
Changing Appearance
slider.tintColor=.cyan // color of trackslider.thumbTintColor=.blue // color of thumbsslider.trackWidth=32slider.hasRoundTrackEnds=trueslider.showsThumbImageShadow=false // wide tracks look better without thumb shadowslider.centerThumbOnTrackEnd=true // when thumb value is minimum or maximum, align it's center with the track end instead of its edge
Images
// add images at the ends of the slider:slider.minimumImage=UIImage(named:"clown")slider.maximumImage=UIImage(named:"cloud")// change image for all thumbs:slider.thumbImage=UIImage(named:"balloon")// or let each thumb have a different image:slider.thumbViews[0].image=UIImage(named:"ball")slider.thumbViews[1].image=UIImage(named:"club")// expand drag area when using a small thumb image:slider.thumbTouchExpansionRadius=16
Distance/Overlap Between Thumbs
// allow thumbs to overlap:slider.keepsDistanceBetweenThumbs=false// make thumbs keep a greater distance from each other (default = half the thumb size):slider.distanceBetweenThumbs=3.14
Disabling/freezing thumbs
slider.disabledThumbIndices=[1,3]
Requirements
iOS 9.0+
Xcode 10
Installation
CocoaPods:
pod'MultiSlider'
Legacy versions:
Swift version
MultiSlider version
4.0 (Xcode 9.4)
pod 'MiniLayout', '~> 1.2.1' pod 'MultiSlider', '~> 1.6.0'
3
pod 'MiniLayout', '~> 1.1.0' pod 'MultiSlider', '~> 1.1.2'
2.3
pod 'MiniLayout', '~> 1.0.1' pod 'MultiSlider', '~> 1.0.1'