MimiActivityIndicator

@MainActor
open class MimiActivityIndicator : MimiView

A View that shows that a task is in progress, and has the ability to show result states.

  • State to display in the indicator.

    • activity: Ongoing indeterminate activity, will display a spinner.
    • finished: Finished activity, with a state depicting the result.
    Declaration

    Swift

    public enum State
    extension MimiActivityIndicator.State: Equatable
  • Current indicator state.

    Declaration

    Swift

    @MainActor
    open private(set) var state: State { get }
  • Whether the indicator is currently animating.

    Declaration

    Swift

    @MainActor
    open private(set) var isAnimating: Bool { get }
  • Color to use for the activity indicator.

    Declaration

    Swift

    @MainActor
    open var color: UIColor? { get set }
  • Declaration

    Swift

    @MainActor
    open override func construct(in view: UIView)
  • Starts the animation of the progress indicator.

    This will display a rotating spinner to indicate indeterminate progress. The indicator will be animated until stopAnimating() or finish(to:) are called. If the indicator is currently in a finished state, it will be animated away first.

    Declaration

    Swift

    @MainActor
    open func startAnimating()
  • Stops the animation of the progress indicator.

    This will stop the rotating spinner on its next cycle if it is currently animating following a startAnimating call. If the indicator is currently in a .finished state, nothing will happen.

    Declaration

    Swift

    @MainActor
    open func stopAnimating(completion: (() -> Void)? = nil)
    Parameters
    completion

    Completion handler.

  • Animate the indicator into a finished state following activity.

    This will animate into the finished state following the next cycle if the indicator is currently animating. If not the finished state will be immediately displayed.

    Declaration

    Swift

    @MainActor
    open func finish(to state: FinishState,
                     completion: (() -> Void)? = nil)
    Parameters
    state

    Finished state to display.

    completion

    Completion handler.

  • Artwork that depicts an error context.

    • none: No artwork.
    • cloud: Cloud, internet services.
    • cross: Cross
    Declaration

    Swift

    public enum ErrorArtwork
  • State for finishing activity, depicting a result.

    • checkmark: Checkmark, successful result.
    • cross: Cross, generic failure.
    • error: Error, failure with artwork displaying the particular error context with a strikethrough overlay.
    Declaration

    Swift

    public enum FinishState : Hashable
    extension MimiActivityIndicator.FinishState: Equatable