ScalePicker 2.5.3

ScalePicker 2.5.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2016
SPMSupports SPM

Maintained by Dmitry Klimkin.



  • By
  • Dmitry Klimkin

ScalePicker

Generic scale and a handy float-value picker for any iOS app.

Preview


Installation

With source code

Download repository, then add ScalePicker directory to your project.

Podfile

platform :ios, '8.0'
use_frameworks!

pod 'ScalePicker'

Usage

Initialisation

Instantiate scale view with preferred frame:

let screenWidth = UIScreen.mainScreen().bounds.size.width
let scaleView = ScalePicker(frame: CGRectMake(0, 0, screenWidth, 50))

view.addSubview(scaleView)

Properties

Set minimum value

scaleView.minValue = -3.0

Set maximum value

scaleView.maxValue = 3.0

Set number of ticks between values value

scaleView.numberOfTicksBetweenValues = 2

Set space between ticks

scaleView.spaceBetweenTicks = 20.0

Set tick label visibility

scaleView.showTickLabels = true

Set a delegate

scaleView.delegate = self

Set ability to snap to the nearest value

scaleView.snapEnabled = true

Set bounces value

scaleView.bounces = false

Set tick (and center/arrow view) color

scaleView.tickColor = UIColor.whiteColor()

Set center/arrow image

scaleView.centerArrowImage = UIImage(named: "arrowPointer")

Control actions

Increase current value

scaleView.increaseValue()

Decrease current value

scaleView.decreaseValue()

Reset current value

scaleView.reset()

Gestures

In addition to increase/decrease/reset actions ScaleView allows you to double tap to trigger reset action

More

For more details try Xcode Demo project

Etc.

  • Contributions are very welcome.
  • Attribution is appreciated (let’s spread the word!), but not mandatory.

Use it? Love/hate it?

Tweet the author @dklimkin, and check out Dmitry’s portfolio: http://dmitry-klimkin.com

License

ScalePicker is released under the MIT license. See LICENSE for details.