Swiftpack.co - JoshHrach/ActivityIndicatorView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by JoshHrach.
JoshHrach/ActivityIndicatorView v1.2.1
SwiftUI replacement for UIActivityIndicatorView
⭐️ 11
🕓 3 years ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/JoshHrach/ActivityIndicatorView.git", from: "v1.2.1")

ActivityIndicatorView

Platforms Swift SwiftPM Twitter

A SwiftUI replacement for UIActivityIndicatorView

Requirements

Version 1.x supports:

  • Xcode 11.4+
  • Swift 5.2+
  • iOS 13.0+, macOS 10.15+, tvOS 13.0+, watchOS 6.0+

Installation

Install ActivityIndicatorView into your project using Swift Package Manager.

Usage

In your SwiftUI .swift file, add import ActivityIndicatorView.

To use, simply add the view where you would like it to appear.

// Example view
HStack {
  // Your content
  ...
  
  // Show indicator next to your content
  ActivityIndicatorView()
}

Modifier

You can easily add an activity indicator to your view similar to how you would add an Alert or ActionSheet. This will overlay an activity indicator with a maximum frame size of 50 by 50. On iOS, this will appear similar to the default size of UIActivityIndicatorView. When overlaid over smaller views, the activity indicator will automatically resize smaller to fit the frame.

// Examples
// Add a default indicator.
.activityIndicator(isVisible: true)

// Add a custom indicator
.activityIndicator(isVisible: true) {
    ActivityIndicatorView(foregroundColor: .green, backgroundColor: .black)
}

Appearance

Basic

You can add the view directly without customization. This will produce a view identical to UIActivityIndicatorView.

Custom

You can customize the view on initialization. By specifying a foregroundColor and backgroundColor, you can adapt the view for your application.

Support

Feel free to leave any feature requests or issues.

Contributing

If you'd like to contribute to improving this project, feel free to fork the project and create a pull request with your changes.

Author

Josh Hrach

@JoshHrach

GitHub

link
Stars: 11
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

1.2.1
3 years ago

Updated package file to specify swift language version supported

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics