ActivityIndicatorView
A number of preset loading indicators created with SwiftUI
Usage
Create an indicator like this:
ActivityIndicatorView(type: .default)
where
type - value from ActivityIndicatorView.IndicatorType enum
You may alter it with standard SwiftUI means like this:
ActivityIndicatorView(type: .default)
.frame(width: 50.0, height: 50.0)
.foregroundColor(.red)
Or specify another indicator type:
ActivityIndicatorView(type: .growingArc(.red, lineWidth: 4))
.frame(width: 50.0, height: 50.0)
Indicator types
Each indicator type has a number of parameters that have reasonable defaults. You can change them as you see fit, but it is advised to not set them too high or too low.default - iOS UIActivityIndicator style
.default(count: 8)
arcs
.arcs(count: 3, lineWidth: 2)
rotatingDots
.rotatingDots(count: 5)
flickeringDots
.flickeringDots(count: 8)
scalingDots
.scalingDots(count: 3, inset: 2)
opacityDots
.opacityDots(count: 3, inset: 4)
equalizer
.equalizer(count: 5)
growingArc - add custom color for growing Arc, the default value is Color.black
.growingArc(.red, lineWidth: 4)
growingCircle - no parameters
gradient - circle with angular gradient border stroke, pass colors like this:
.gradient([.white, .red], lineWidth: 4)
Examples
To try ActivityIndicatorView examples:
- Clone the repo
https://github.com/exyte/ActivityIndicatorView.git - Open
ActivityIndicatorViewExample.xcodeproj - Try it!
Installation
Swift Package Manager
dependencies: [
.package(url: "https://github.com/exyte/ActivityIndicatorView.git")
]
Requirements
- iOS 13+ / watchOS 6+ / tvOS 13+ / macOS 10.15+
- Xcode 11+


