Latest 1.0.0
Homepage https://github.com/daprice/iOS-Tactile-Slider
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

A slider control designed to be easy to grab and use because it can be dragged or tapped from anywhere along its track, similar to the sliders in Control Center and HomeKit.

Animated gif of TactileSliders animating to values

Features

  • Can be dragged or (optionally) tapped to set a value
  • Supports horizontal and vertical orientation in either direction
  • IBDesignable – colors, values, rounded corners, and behavior can be customized in Interface Builder or programatically
  • Adjustable haptic feedback (iOS 10+)
  • VoiceOver support

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.0+ (iOS 10.0+ required for haptic feedback)

Installation

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

pod 'TactileSlider'

Usage

let slider = TactileSlider(frame: someRect)

slider.minimumValue = 1
slider.maximumValue = 10

slider.setValue(3.8, animated: true)

Setting orientation and direction

slider.vertical = true
slider.reverseValueAxis = true

Adjusting behavior

slider.isContinuous = false
slider.enableTapping = false // allow or disallow tapping anywhere on the slider track to instantly set a value
slider.scaleUpWhenInUse = true // make the slider puff up slightly while being dragged

Changing colors and appearance

slider.trackBackground = UIColor.black.withAlpha(0.8)
slider.thumbTint = UIColor.blue
slider.cornerRadius = 12

Interface Builder

screenshot of Xcode Interface Builder demonstrating a TactileSlider being customized using the graphical interface

Author

Dale Price (@[email protected])

License

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

Latest podspec

{
    "name": "TactileSlider",
    "version": "1.0.0",
    "summary": "Easy-to-grab slider control inspired by Control Center and HomeKit.",
    "description": "A slider control designed to be easy to grab and use because it can be dragged or tapped from anywhere along its track, similar to the sliders in Control Center and HomeKit.",
    "homepage": "https://github.com/daprice/iOS-Tactile-Slider",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dale Price": "[email protected]"
    },
    "source": {
        "git": "https://github.com/daprice/iOS-Tactile-Slider.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://mastodon.technology/@dale_price",
    "platforms": {
        "ios": "8.0"
    },
    "swift_version": "4.2",
    "source_files": "TactileSlider/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This