Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JoshHrach/ActivityIndicatorView
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshHrach committed Jun 12, 2020
2 parents 13d4e9b + 7d06faf commit fd19ba9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,36 @@ Install `ActivityIndicatorView` into your project using `Swift Package Manager`.

In your SwiftUI `.swift` file, add `import ActivityIndicatorView`.

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

```swift
// 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.

```swift
// 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`.
Expand Down

0 comments on commit fd19ba9

Please sign in to comment.