ShimmerEffect is a lightweight library that provides a custom modifier for SwiftUI views, allowing you to easily add shimmering effects to your UI components.
- Easily add shimmer effect to any SwiftUI view.
- Customizable shimmer animation speed, gradient colors, and direction.
- iOS 15
- Swift 5.5
You can install Shimmer-SwiftUI-Modifier using Swift Package Manager. In Xcode, go to File > Swift Packages > Add Package Dependency and enter the repository URL.
dependencies: [
.package(url: "https://github.com/0xYanis/Shimmer-SwiftUI-Modifier.git", from: "1.0.0")
]
Adding shimmer effect to a view is as simple as applying the shimmer
modifier to it:
import SwiftUI
import ShimmerEffect
struct ContentView: View {
var body: some View {
Text("Hello, Shimmer!")
.shimmer(true)
}
}
You can customize the shimmer effect by providing parameters to the shimmerEffect
modifier:
Text("Hello, Customized Shimmer!")
.shimmerEffect(isActive: true, speed: 1.2, colors: [.gray, .white], cornerRadius: 8)
ShimmerEffect is available under the MIT license. See the LICENSE file for more info.
Contributions are welcome! Feel free to submit pull requests, create issues, or suggest new features.
ShimmerEffect is maintained by [0xYanis].
Enjoy using the library and happy shimmering!