ActivityIndicatorView Documentation

repository·master·Indexed 23 days ago

https://github.com/exyte/activityindicatorview

A SwiftUI library providing a variety of preset, highly customizable animated loading indicators. It includes multiple styles via the ActivityIndicatorView.IndicatorType enum, such as .default, .rotatingDots, and .growingArc, and supports iOS 13+, watchOS 6+, tvOS 13+, and macOS 10.15+.

Tokens
571
Snippets
2
Records
4
Agent score
32%

What's inside ActivityIndicatorView

  1. Use ActivityIndicatorView in SwiftUI

    master

    To create a loading indicator, initialize ActivityIndicatorView with a specific type from the ActivityIndicatorView.IndicatorType enum. You can customize the appearance using standard SwiftUI modifiers like .frame() and .foregroundColor().

    // Basic usage
    ActivityIndicatorView(type: .default)
    
    // Customized usage
    ActivityIndicatorView(type: .default)
        .frame(width: 50.0, height: 50.0)
        .foregroundColor(.red)
    
    // Usage with specific parameters
    ActivityIndicatorView(type: .growingArc(.red, lineWidth: 4))
        .frame(width: 50.0, height: 50.0)
  2. Configure ActivityIndicatorView indicator types

    master

    The ActivityIndicatorView.IndicatorType enum provides several preset styles. Most types accept parameters to adjust their appearance (like count, lineWidth, or inset), but they come with reasonable defaults.

    Available types and their parameter patterns:

    • .default(count: Int): iOS UIActivityIndicator style.
    • .arcs(count: Int, lineWidth: CGFloat): Multiple arcs.
    • .rotatingDots(count: Int): Dots that rotate.
    • .flickeringDots(count: Int): Dots with a flickering effect.
    • .scalingDots(count: Int, inset: CGFloat): Dots that scale.
    • .opacityDots(count: Int, inset: CGFloat): Dots with opacity changes.
    • .equalizer(count: Int): An equalizer-style animation.
    • .growingArc(Color, lineWidth: CGFloat): An arc that grows; allows custom color.
    • .growingCircle(): A growing circle animation.
    • .gradient([Color], lineWidth: CGFloat): A circle with an angular gradient border stroke.