Code Monkey home page Code Monkey logo

circularslider's Introduction

CircularSlider

A powerful Circular Slider. It's written in Swift, it's 100% IBDesignable and all parameters are IBInspectable.

Demo

Slider demo

Installation

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

Swift 3:

pod 'CircularSlider'

Swift 2.2:

pod 'CircularSlider' ', '~> 0.2'

Usage

You can use this slider by declaring programmatically or by placing it in your Storyboard file. All the paramters are IBInspectable, so you can configure the slider directly in the Storyboard file (in the attribute inspector tab) without write any line of code!

Delegate

Optionally you can conforms to the methods of the CircularSliderDelegate protocol.

If you want to admit only certain values you can implement this methods:

optional func circularSlider(circularSlider: CircularSlider, valueForValue value: Float) -> Float

With this method you override the actual slider value before the slider is updated. Example: you want only rounded values:

func circularSlider(circularSlider: CircularSlider, valueForValue value: Float) -> Float {
return floorf(value)
}

The other methods you can implement are:

optional func circularSlider(circularSlider: CircularSlider, didBeginEditing textfield: UITextField)
optional func circularSlider(circularSlider: CircularSlider, didEndEditing textfield: UITextField)

Author

taglia3, [email protected]

LinkedIn, Matteo Tagliafico

License

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

circularslider's People

Contributors

mtagliafico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circularslider's Issues

Pull request: fix Swift warnings, add TextColor as IBDesignable ?

Hello taglia3,

Thanks for this fine CircularSlider library.
I get a couple of swift warnings with newest xcode, 8.3.3, mainly M_PI usage and unused runtime attribute 'type'.

I want to fix this. Also I want to add a IBDesignable for the text color of the value label.
Is this project still active? Do you accept a pull-request for these changes?
Thanks, Tom

How do I get values?

How do I get values from the value range that I defined in interface builder?

I installed CircularSlider from CocoaPods and added it in my main.storyboard, then I set the range from 1 to 1000, but I cannot get the values in the range 1-1000... I always get values in the following delegate functions from -2.X to 1.6... to 3.14....

func circularSlider(circularSlider: CircularSlider, didBeginEditing textfield: UITextField) {
    
    //print("\(String(describing: textfield.text))")
    
}

func circularSlider(circularSlider: CircularSlider, didEndEditing textfield: UITextField) {
    
    print("asdf \(String(describing: circularSlider.title))")
    
}

}

// MARK: - CircularSliderDelegate
extension ViewController: CircularSliderDelegate {
func circularSlider(_ circularSlider: CircularSlider, valueForValue value: Float) -> Float {
return floorf(value)
}
}

0.0
-1.64434761728344
...
2.98358034030751
3.07363463664357
-3.07239637497121
...
-2.38914958780664
...
-1.53983277461192
-1.460139105621
-1.40709587429103
...
-1.87021156844839
...
2.73103520554794

Bitcode Processing Failed

While processing your iOS app, errors occurred in the app thinning process, and your app couldn’t be thinned. If your app contains bitcode, bitcode processing may have failed. Because of these errors, this build of your app will not be able to be submitted for review or placed on the App Store.

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.