Latest 0.0.3
Homepage https://github.com/luiswdy/SGauge
License MIT
Platforms ios 9.0
Authors

CI Status
Version
License
Platform
language

Example

To run the example project, run pod try SGauge.

Requirements

-iOS SDK 9.0 or later

Installation

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

pod "SGauge"

How to use

  1. Add an UIView from ‘Object Library’ of ‘Utilities’

  2. Click the view you’ve just added and set the both class and module of the view to ‘SGauge’. You shall see the gauge then.

  3. Customize gauge’s appearance through Attribute Inspector

  4. Declare a property of type SGauge with @IBOutlet qualifier in your view controller. For instance:
    @IBOutlet var gauge: SGauge!
  5. Connect the gauge with the property through Interface Builder.
  6. To move the needle, simply assign a value to the gauge. For instance:
    gauge.value = CGFloat(50)

Customizable attributes

  • Max Value: The maximum value expressible for the gauge (Default: 100).
  • Min Value: The minimum value expressible for the gauge (Default: 0).
  • Arc Color: The color of the arc of the gauge (Default: clear).
  • Arc Outline Color: The color of the outline of the arc (Default: black).
  • Needle Color: The color of the gauge’s needle (Default: red).
  • Arc Width: The thickness of the arc (Default: 20).
  • Arc Outline Width: The thickness of the arc’s outline (Default: 1).
  • Needle Width: The thickness of the needle (Default: 1).
  • Graduation Unit: The inteval between graduation marks, denoted by value (Default: 10).
  • Graduation Length: The length of graduation marks (Default: 10).
  • Additional Needle Length: You may change needle length by adjusting this value (Default: 0).
  • Animation Duration: The duration of needle’s rotation when the gauge’s value changed (Default: 0.1 sec).

Author

Luis Wu, lunarseawu@gmail.com

Thanks to

License

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

Latest podspec

{
    "name": "SGauge",
    "version": "0.0.3",
    "summary": "A simple and customizable gauge.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/luiswdy/SGauge",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Luis Wu": "lunarseawu@gmail.com"
    },
    "source": {
        "git": "https://github.com/luiswdy/SGauge.git",
        "tag": "0.0.3"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "SGauge/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This