An attempt to recreate the ring controls in Apple’s Activity app
ActivityRings is an attempt to recreate the ring controls in Apple’s Activity app.
This project is a SpriteKit port of Max Konovalov’s pure UIKit implementation, MKRingProgressView.
ActivityRings is available via CocoaPods and Carthage.
To install ActivityRings using CocoaPods, add the following line to your Podfile:
pod 'ActivityRings'
To install ActivityRings using Carthage, add the following line to your Cartfile:
github "HarshilShah/ActivityRings"
To get started, import ActivityRings
. To display the control, use the ActivityRingView
class on iOS, macOS, and tvOS, and the ActivityRingScene
class on watchOS.
The ringWidth
, the startColor
, the endColor
, and the backgroundRingColor
can all be customised.
The progress of the ring can be set with or without animation.
To set the progress without animation, simply update the value of the progress
variable.
To animate the progress, use the animateProgress
method, which accepts two arguments:
Some notes on performance:
Feel free to submit a PR if you’re using this library in your apps.
Written by Harshil Shah. You can find me on Twitter.
The original UIKit implementation was written by Max Konovalov.
ActivityRings is available under the MIT license. See the LICENSE.md file for more info.