Latest 0.0.9
Homepage https://github.com/jevin/SwiftyKnob.git
License MIT
Platforms ios 8.0
Authors

404: Not Found

Latest podspec

{
    "name": "SwiftyKnob",
    "version": "0.0.9",
    "summary": "An easy way to add knobs in your app",
    "description": "# SwiftyKnobnn[![Version](https://img.shields.io/cocoapods/v/SwiftyKnob.svg?style=flat)](http://cocoapods.org/pods/SwiftyKnob)n![Swift 3.0.x](https://img.shields.io/badge/Swift-3.0.x-orange.svg)nnSwiftyKnob allows you to easily add knobs in your iOS apps. If you are unfamiliar with knobs, they are basically curved progress bars. You can use them to show profile completion, stats or just about anything else!nnHere's what it looks like:nnSwiftyKnob demonn## Installationnn**Via [Cocoapods](https://cocoapods.org/)**nn```rubynpod "SwiftyKnob"n```nn**Manually**nnJust drag the `Knob.swift` in `SwiftyKnob/Classes/` to your project tree and you're ready to go.nn## Usagenn### In codenn```swiftnlet knob = Knob(frame: CGRect(x: 8, y: 20, width: 100, height: 100),n          borderWidth: 18,n          borderColor: UIColor.red,n          value: 0.78, n          text: "78%",n          description: "open rate"n)nnview.addSubview(knob)n```nSimply initialize the `Knob` class with the wanted parameters and add it to the view. The knob will animate automatically when needed. nnFor a detailed description of the `Knob` initializer see the following table:nnParameter | Descriptionn--- | ---nframe | The rectangle defining the size and position of the knobnborderWidth | The width of the knob's bordernborderColor | The color of the above bordernvalue | The value of the knob. Should be between 0.0 and 1.0ntext | The main text, displayed at the center of the knobndescription | A smaller description, displayed below the text abovenn#### Controlling animationsnBy default, the knob animates as soon as it's drawn. If you want to control that, you can use the follwing code:nn```swiftnlet knob = Knob(frame: CGRect(x: 8, y: 20, width: 100, height: 100),n          borderWidth: 18,n          borderColor: UIColor.red,n          value: 0.78, n          text: "78%",n          description: "open rate",n          autoAnimate: falsen)n```nThe last parameter tells SwiftyKnob **not** to animate the knob when it's drawn. You can then use the following line to fire the animation.nn```swiftnknob.animate()n```n**Note:** Calling `animate` inside `viewDidLoad` will not work. Instead you should call it in `viewDidAppear`.nn### In storyboardsnn1. Add a `UIView` to your scenenn2. Make `Knob` the custom class of your viewnn![Image 1](https://github.com/jevin/SwiftyKnob/blob/master/images/storyboard-1.png)nn3. Customize your knob using the exposed attributesnn![Image 2](https://github.com/jevin/SwiftyKnob/blob/master/images/storyboard-2.png)nn## Contributingnn1. Fork it!n2. Create your feature branch: `git checkout -b my-new-feature`n3. Commit your changes: `git commit -am 'Add some feature'`n4. Push to the branch: `git push origin my-new-feature`n5. Submit a pull requestnn## CreditsnnThanks to [@mikedev](https://twitter.com/mikedev) for his [awesome answer](http://stackoverflow.com/questions/26578023/animate-drawing-of-a-circle/26578895#26578895) on StackOverflow about `CAShapeLayer` and `CABasicAnimation`!nn## LicensennSwiftyKnob is available under the MIT License. See the LICENSE file for more info.nnIf you like what I do, you should follow me on Twitter: [@jevinsew](https://twitter.com/jevinsew/) u270cufe0f",
    "homepage": "https://github.com/jevin/SwiftyKnob.git",
    "license": "MIT",
    "authors": {
        "jevin": "[email protected]"
    },
    "social_media_url": "http://twitter.com/jevinsew",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/jevin/SwiftyKnob.git",
        "tag": "0.0.9"
    },
    "source_files": "SwiftyKnob/Classes/**/*",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This