GithubHelp home page GithubHelp logo

keblodev / scalepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kronik/scalepicker

2.0 1.0 0.0 15.92 MB

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

Home Page: https://github.com/kronik/ScalePicker

License: MIT License

Ruby 0.14% Swift 22.88% Objective-C 75.22% Shell 1.76%

scalepicker's Introduction

Platform: iOS 8+ Language: Swift 2.2 Carthage compatible License: MIT

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.

With CocoaPods

CocoaPods is a dependency manager for Objective-C/Swift, which automates and simplifies the process of using 3rd-party libraries in your projects. To install with cocoaPods, follow the "Get Started" section on CocoaPods.

Podfile

platform :ios, '8.0'
use_frameworks!

pod 'ScalePicker'

With Carthage

Carthage is a lightweight dependency manager for Swift and Objective-C. It leverages CocoaTouch modules and is less invasive than CocoaPods. To install with carthage, follow the instruction on Carthage.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

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

github "kronik/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.

scalepicker's People

Contributors

kronik avatar

Stargazers

Root Access avatar EvenYan avatar

Watchers

Keblo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.