A lightweight, reusable SwiftUI loading spinner package with multiple animated styles and an easy-to-use view modifier. Perfect for showing loading states in your apps with style.
- ✅ Multiple spinner variants:
.default,.circle,.dots,.gradient - 🎨 Customizable size and color
- 🔁 Animated and smooth
- 🧩 Easy integration via
.loadingSpinner()view modifier - 📦 Swift Package Manager (SPM) support
- In Xcode, go to
File>Add Packages... - Enter the URL of this repository:
https://github.com/hassan31/loading-spinner - Select the latest version and add it to your app target.
import LoadingSpinnerstruct ContentView: View {
@State private var isLoading = true
var body: some View {
VStack {
Text("Fetching data...")
Button("Toggle Loading") {
isLoading.toggle()
}
}
.loadingSpinner(isPresented: $isLoading, variant: .dots, color: .purple, size: 40)
}
}| Variant | Preview | Description |
|---|---|---|
.default |
🌀 | Native ProgressView style |
.circle |
🔵 | Animated circular stroke |
.dots |
⚫ ⚫ ⚫ | Bouncing dots animation |
.gradient |
🎨 | Rotating angular gradient ring |
- iOS 14.0+
- Swift 5.7+
- SwiftUI
Contributions, ideas, and feedback are always welcome! Feel free to open issues or pull requests.
MIT License. See LICENSE for details.
Made with ❤️ by @hassan31
