-
I have been trying out the new LottieView. Is there a way to show loading somehow while code in .configure is running?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
One way to show a loading indicator is using this LottieView {
LottieAnimation.named(imageName)
} placeholder: {
// Displayed until the animation is loaded
MyLoadingIndicator()
} Alternatively you could do something like: LottieView(animation: LottieAnimation.named(imageName))
.animationDidLoad {
// The animation has now finished loading. Called exactly once.
} |
Beta Was this translation helpful? Give feedback.
.configure
is called on every SwiftUI state update so shouldn't be used for anything stateful like this. What are you trying to do exactly?One way to show a loading indicator is using this
init
syntax:Alternatively you could do something like: