A lightweight and customizable shimmer loading view for iOS — built with UIView and SwiftUI support.
- ✅ Simple API with SwiftUI chaining
- 🎨 Customizable shimmer color, base color, corner radius
- 🔁 Dynamic rotation angle (0° to 360°)
- 🧱 Lightweight and fast — works with both UIKit & SwiftUI
SwiftUI
DShimmerView()
.baseColor(.lightGray.withAlphaComponent(0.4))
.shimmerColor(.white.withAlphaComponent(0.3))
.rotationDegree(20)
.frame(maxWidth: 140)
.frame(height: 120)
Button {} label: {
Text("Button With Text Shimmer")
.foregroundColor(.white)
.padding(.horizontal, 12)
.padding(.vertical, 16)
.bold()
.dshimmer(baseColor: .clear, shimmerColor: .gray)
}
UIKit
Swift Package Manager
File > Swift Packages > Add Package Dependency
-
Search DShimmer or Add Package URL https://github.com/d-putra/DShimmer.git
-
Select "Up to Next Major" with "1.0"
Cocoapods
Add this to your Podfile :
pod 'DShimmer', :git => 'https://github.com/d-putra/DShimmer.git', :tag => '1.0'