Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI
View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS and watchOS.
import SwiftUI import Shimmer ⋮ ⋮ Text("SwiftUI Shimmer").modifier(Shimmer())
or more conveniently
active: Convenience parameter to conditionally enable the effect. Defaults to
duration: The duration of a shimmer cycle in seconds. Default:
bounce: Whether to bounce (reverse) the animation back and forth. Defaults to
delay: A delay in seconds. Defaults to
You can now provide a custom animation:
Text("Loading...") .shimmering( active: isAnimating, animation: .easeInOut(duration: 2).repeatCount(5, autoreverses: false).delay(1) )
Of course, you can combine
.shimmering(...) with the
.redacted(...) modifier to create interesting animated skeleton views.
Text("Some text") .redacted(reason: .placeholder) .shimmering()
SwiftUI-Shimmer can be installed using Swift Package Manager.
Use the package URL to search for the URLImage package: https://github.com/markiv/SwiftUI-Shimmer.
For how-to integrate package dependencies refer to Adding Package Dependencies to Your App documentation.
Mobile App Development Best Practices – 28.09
iOS Decodable CoreData: A Proof-of-Concept for Building Offline-First iOS Apps The Future of Accessing User Location in SwiftUI Create SPM...
What is Dependency Injection
The primary goal of dependency injection is to reduce the coupling between components by removing the dependency resolution responsibility from...
Dependency Management in a Multi-Module Project – THIS Is How You Need to Do It
⭐ Learn how to make apps scale with a multi-module architecture.
Raspberry Pi 5 microcomputer unveiled
At launch, the Raspberry Pi 5 will come with several RAM options: $60 for the 4GB version and $80 for...
Cashew – Personal finances on Flutter
Cashew is a full-fledged, feature-rich application designed to empower users in managing their finances effectively. Built using Flutter – with...
Mobile App Development Best Practices – 27.09
Swipe Actions from Scratch, Effective code reviews for Android developers, WebP exploit and more!