To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 7.1+
- Xcode 8.0
HGCircularSlider is available through CocoaPods. To install it, simply add the following line to your Podfile:
# Swift 3.0 - Xcode 8
pod 'HGCircularSlider', '~> 1.0.3'
# Swift 2.2 - Xcode 7.3.1 (Checkout Swift2_Xcode7.3 branche)
pod 'HGCircularSlider', '~> 0.1.2'
- Change the class of a view from UIView to CircularSlider, RangeCircularSlider or MidPointCircularSlider
- Programmatically:
let circularSlider = CircularSlider(frame: myFrame)
circularSlider.minimumValue = 0.0
circularSlider.maximumValue = 1.0
circularSlider.endPointValue = 0.2
OR
let circularSlider = RangeCircularSlider(frame: myFrame)
circularSlider.startThumbImage = UIImage(named: "Bedtime")
circularSlider.endThumbImage = UIImage(named: "Wake")
let dayInSeconds = 24 * 60 * 60
circularSlider.maximumValue = CGFloat(dayInSeconds)
circularSlider.startPointValue = 1 * 60 * 60
circularSlider.endPointValue = 8 * 60 * 60
OR
let circularSlider = MidPointCircularSlider(frame: myFrame)
circularSlider.minimumValue = 0.0
circularSlider.maximumValue = 10.0
circularSlider.distance = 1.0
circularSlider.midPointValue = 5.0
Full documentation is available on CocoaDocs.
You can also install documentation locally using jazzy.
The UI examples of the demo project inspired from Dribbble.
The project is Inspired by UICircularSlider
Hamza Ghazouani, [email protected]
HGCircularSlider is available under the MIT license. See the LICENSE file for more info.