Skip to content
A custom reusable circular / progress slider control for iOS application.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Added .github/ISSUE_TEMPLATE.md (optional) Feb 2, 2018
Example add the swift version to podspec and remove .swift-version Feb 13, 2019
HGCircularSlider.xcodeproj Restored example project. Updated swift syntax. Apr 13, 2017
HGCircularSlider refactor: if endPointValue is set below minimumValue, the property au… Dec 9, 2018
Screenshots Update Gifs and ReadMe Apr 17, 2017
.codebeatsettings Update .codebeatsettings Nov 8, 2016
.gitignore Update documentation Nov 16, 2016
.jazzy.yaml Create .jazzy.yaml Nov 10, 2016
.travis.yml Update .travis.yml Dec 18, 2018
CHANGELOG.md New version compatible with swift 4.2 Feb 13, 2019
CONTRIBUTING.md Added CONTRIBUTING.md (optional) Feb 2, 2018
HGCircularSlider.podspec add the swift version to podspec and remove .swift-version Feb 13, 2019
LICENSE First import Nov 8, 2016
README.md

README.md

HGCircularSlider

Backers on Open Collective Sponsors on Open Collective Twitter: @GhazouaniHamza CI Status Version License Language Platform Carthage compatible

codebeat badge Documentation Readme Score

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

You also may like

  • HGPlaceholders - Nice library to show placeholders for any UITableView in your project
  • HGRippleRadarView - A beautiful radar view to show nearby users with ripple animation, fully customizable

Requirements

  • iOS 9.0+
  • Xcode 10.0

Installation

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

# Swift 3.1 - Xcode 8.3
pod 'HGCircularSlider', '~> 2.0.0'

# Swift 3 - Xcode 8
pod 'HGCircularSlider', '~> 1.0.3'

# Swift 2.2 - Xcode 7.3.1 (Checkout Swift2_Xcode7.3 branche)
pod 'HGCircularSlider', '~> 0.1.2'

HGCircularSlider is also available through Carthage. To install it, simply add the following line to your Cartfile:

# Swift 3.1 - Xcode 8
github "HamzaGhazouani/HGCircularSlider"

Usage

  1. Change the class of a view from UIView to CircularSlider, RangeCircularSlider or MidPointCircularSlider
  2. 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
circularSlider.numberOfRounds = 2 // Two rotations for full 24h range

OR

let circularSlider = MidPointCircularSlider(frame: myFrame)
circularSlider.minimumValue = 0.0
circularSlider.maximumValue = 10.0
circularSlider.distance = 1.0
circularSlider.midPointValue = 5.0
If you would like to use it like a progress view
let progressView = CircularSlider(frame: myFrame)
progressView.minimumValue = 0.0
progressView.maximumValue = 1.0
progressView.endPointValue = 0.2 // the progress 
progressView.userInteractionEnabled = false 
// to remove padding, for more details see issue #25
progressView.thumbLineWidth = 0.0
progressView.thumbRadius = 0.0

Documentation

Full documentation is available on CocoaDocs.
You can also install documentation locally using jazzy.

References

The UI examples of the demo project inspired from Dribbble.

Player
BasicExample
OClock

The project is Inspired by UICircularSlider

Author

Hamza Ghazouani, hamza.ghazouani@gmail.com

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

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

You can’t perform that action at this time.