Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MojtabaHs/ActivityIndicator-SwiftUI
A Native SwiftUI Activity Indicator Pack.
https://github.com/MojtabaHs/ActivityIndicator-SwiftUI
Last synced: about 2 months ago
JSON representation
A Native SwiftUI Activity Indicator Pack.
- Host: GitHub
- URL: https://github.com/MojtabaHs/ActivityIndicator-SwiftUI
- Owner: MojtabaHs
- Created: 2020-09-29T15:50:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-10T22:51:28.000Z (about 4 years ago)
- Last Synced: 2024-05-18T21:38:39.631Z (8 months ago)
- Language: Swift
- Size: 29.3 KB
- Stars: 86
- Watchers: 3
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-swiftui-libraries - iActivityIndicator - A Native SwiftUI Activity Indicator Pack (Loading-Indicator / Content)
README
# ActivityIndicator
An Elegant And Customizable Pure SwiftUI Activity Indicators.
# Examples
Code | Demo
--- | ---
![Arcs-Code][11] | ![Arcs][1]
![Blinking-Code][9] | ![Blinking][2]
![RotatingShapesCode][7] | ![RotatingShapes][3]
![RowOfShapes-Code][6] | ![RowOfShaoes][4]
![Bars-Code][10] | ![Bars][5][1]: https://i.sstatic.net/kVFyr.gif
[2]: https://i.sstatic.net/J9dvw.gif
[3]: https://i.sstatic.net/zxoqs.gif
[4]: https://i.sstatic.net/wFRVi.gif
[5]: https://i.sstatic.net/2TwUG.gif
[6]: https://i.sstatic.net/gdaNb.png
[7]: https://i.sstatic.net/PRD5B.png
[8]: https://i.sstatic.net/DMFLk.png
[9]: https://i.sstatic.net/xalsy.png
[10]: https://i.sstatic.net/YHkfX.png
[11]: https://i.sstatic.net/XLPvH.png
---
# The Demo CodeJust import the library and use the following code as the `ContentView`
```
import SwiftUI
import iActivityIndicatorstruct ContentView: View {
var body: some View {
VStack(spacing: 24) {HStack(spacing: 24) {
iActivityIndicator(style: .arcs())
iActivityIndicator(style: .arcs(width: 8))
iActivityIndicator(style: .arcs(count: 10))
}HStack(spacing: 24) {
iActivityIndicator(style: .bars(opacityRange: 1...1))
iActivityIndicator(style: .bars(scaleRange: 1...1))
iActivityIndicator(style: .bars(count: 3))
}HStack(spacing: 24) {
iActivityIndicator(style: .blinking())
iActivityIndicator(style: .blinking(count: 4))
iActivityIndicator(style: .blinking(count: 3, size: 50))
}HStack(spacing: 24) {
iActivityIndicator() // The Default
iActivityIndicator(style: .classic(count: 13, width: 2))
iActivityIndicator(style: .classic(count: 3, width: 50))
}HStack(spacing: 24) {
iActivityIndicator(style: .rotatingShapes())
iActivityIndicator(style: .rotatingShapes(count: 3, size: 30))
iActivityIndicator(style: .rotatingShapes(content: AnyView(Text("🎃").fixedSize())))
}HStack(alignment: .center, spacing: 24) {
iActivityIndicator(style: .rowOfShapes())
iActivityIndicator(style: .rowOfShapes(count: 1, opacityRange: 0...1))
iActivityIndicator(style: .rowOfShapes(count: 3, scaleRange: 0.1...1))
}
}
.padding()
.foregroundColor(.red)
}
}
```# Ease of Use
Also you can use style as a modifer on the `iActivityIndicator` like:
```
HStack(spacing: 24) {
iActivityIndicator()
.style(.arcs())iActivityIndicator()
.style(.arcs(width: 8))iActivityIndicator()
.style(.arcs(count: 10))
}
```