SFGaugeView
A custom UIView with a gauge control (tachometer like control). Detects swipe gesture and sets the needle/level appropriately. You can customize colors, the maximum level, min/max images, etc.
Setup
Installing with CocoaPods
If you're unfamiliar with CocoaPods you can check out this tutorial here.
-
In Terminal navigate to the root of your project.
-
Run 'touch Podfile' to create the Podfile.
-
Open the Podfile using 'open -e Podfile'
-
Add the pod
SFGaugeView
to your Podfile.platform :ios, '7.0' pod 'SFGaugeView'
-
Run
pod install
. -
Open your app's
.xcworkspace
file to launch Xcode and start using the control!
Usage
-
Either create SFGaugeView by dragging UIView from storyboard and change implementing class or create it programmatically
-
Create an outlet (if create via storyboard)
-
Set up parameters
maxlevel = The maximum level of gauge control (unsigned int value) minlevel = The minimum level of gauge control (unsigned int value) needleColor = Color of needle bgColor = Background Color of gauge control hideLevel = If set to YES the current level is hidden minImage = An image for min level (see screenshot) maxImage = An image for max level (see screenshot) currentLevel = Sets the current Level autoAdjustImageColors = Overlays the images with needleColor (default: NO)
-
GaugeControl interaction currentLevel = Returns the current level
Delegate Method
- (void) sfGaugeView:(SFGaugeView*) gaugeView didChangeLevel:(NSInteger) level;
Author(s)
Licence
Distributed under the MIT License.