Customizable iOS Gauge.
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Swift Version : 5.+
- iOS Version: 10.+
To install SmartGauge, simply add the following line to your Podfile:
pod 'SmartGauge'
import SmartGauge
Add a UIView to the Storyboard/Xib and update the class to SmartGauge
.
Create an outlet and configure as per your need.
gaugeView.numberOfMajorTicks = 10
gaugeView.numberOfMinorTicks = 3
gaugeView.gaugeMaxValue = 300
gaugeView.gaugeAngle = 60
gaugeView.gaugeTrackColor = UIColor.blue
gaugeView.gaugeValue = 20
You can also setup the gauge by using SGRanges
with differnt range values & colors.
let first = SGRanges("first", fromValue: 0, toValue: 20, color: .blue)
let second = SGRanges("second", fromValue: 20, toValue: 40, color: .green)
let third = SGRanges("third", fromValue: 40, toValue: 80, color: .red)
gaugeView.rangesList = [first, second, third]
gaugeView.gaugeMaxValue = third.toValue
Rameez Ibrahim
SmartGauge is available under the MIT license. See the LICENSE file for more info.