GDGauge - Customizable Gauge View
Easy to use, highly customizable gauge view.
Requirements
- Xcode 11+
- Swift 5
- iOS 9+
Installation
Cocoapods
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'GDGauge'
end
pod update
pod install
Usage
import GDGauge
Create an instance of GDGaugeView
var gaugeView: GDGaugeView = GDGaugeView(frame: view.bounds)
Setup, customize and build the view
gaugeView
.setupGuage(startDegree: CGFloat,
endDegree: CGFloat,
sectionGap: CGFloat,
minValue: CGFloat,
maxValue: CGFloat)
.setupContainer(width: CGFloat,
color: UIColor,
handleColor: UIColor,
shouldShowContainerBorder: Bool,
shouldShowFullCircle: Bool,
indicatorsColor: UIColor,
indicatorsValuesColor: UIColor,
indicatorsFont: UIFont)
.setupUnitTitle(title: String,
font: UIFont)
.buildGauge()
Other methods
To update the handle value
gaugeView.updateValueTo(CGFloat)
To update colors when a limit is reached
gaugeView.updateColors(containerColor: UIColor,
indicatorsColor: UIColor)
To reset to initial colors
gaugeView.resetColors()
Licence
GDGauge is available under the MIT license. See the LICENSE.txt file for more info.