KDCircularActivityIndicator is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KDCircularActivityIndicator'
You can easily customize the animation with the following self-descriptive properties:
lineWidth
: This property controls the width of the circular stroke pathstrokeStartDuration
: Duration for stroke start animationstrokeEndDuration
: Duration for stroke end animationspinDuration
: Rotating duration for 2pishouldAutoReverseAnimation
: Indicates whether the animation should be reversedlineDash
: The pattern used to draw the linecolors
: The colors to add to the indicator
Initialize the indicator like this or any other way you want
lazy var activityIndicator: KDCircularActivityIndicator = {
let indicator = KDCircularActivityIndicator()
indicator.colors = [.red, .blue]
indicator.translatesAutoresizingMaskIntoConstraints = false
return indicator
}()
Call startAnimating() to you know what
activityIndicator.startAnimating()
Call stopAnimating() to you also know what
activityIndicator.stopAnimating()
This framework was written by Kauna Mohammed.
KDCircularActivityIndicator was inspired by an Objective-C framework - DTCircularActivityIndicator.
The API of KDCircularActivityIndicator has been designed to be as close as possible to DTCircularActivityIndicator for consistency and it's also designed with a swifty feeling ✌🏿. Check out DTCircularActivityIndicator if you want a framework with the same functionality in Objective-C.
KDCircularActivityIndicator is available under the MIT license. See the LICENSE file for more info.