You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when attempting to load large dotlottie animations (over 5 MB) that contain built-in assets, I experience brief UI thread blocking, typically lasting a few tenths to hundreds of milliseconds. This issue occurs only on the initial load, significantly impacting the user experience by momentarily freezing the interface.
After the initial load, animations appear cached, and the freezing issue no longer occurs.
I tried to solve this by creating a custom animation view controller with pre-loading functionality, but the issue still occurs on the first viewDidLoad event.
Switching rendering engine does not seem to have any effect on the issue.
Is there a way to load the animation without blocking main UI thread (but preferably showing a custom loader)?
Steps to Reproduce:
Use a (dot)lottie animation file larger than 5 MB with embedded assets.
Display the animation conditionally.
Observe the UI thread hang during the first render.
if showAnimation {LottieView{awaitself.loadAnimation() // load larger animation with built in assets
} placeholder:{ProgressView().frame(width:50, height:50)}
//.configuration(LottieConfiguration(renderingEngine: .mainThread))
.logger(.printToConsole).resizable()}Button("Toggle show animation"){
showAnimation.toggle() // watch the UI thread hang after first click
}
Environment Details:
Platform: iOS
Lottie Version: 4.5.1, also tested on almost every 4.x.x version...
This discussion was converted from issue #2530 on February 05, 2025 16:16.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi lottie dev team,
when attempting to load large dotlottie animations (over 5 MB) that contain built-in assets, I experience brief UI thread blocking, typically lasting a few tenths to hundreds of milliseconds. This issue occurs only on the initial load, significantly impacting the user experience by momentarily freezing the interface.
After the initial load, animations appear cached, and the freezing issue no longer occurs.
I tried to solve this by creating a custom animation view controller with pre-loading functionality, but the issue still occurs on the first
viewDidLoad
event.Switching rendering engine does not seem to have any effect on the issue.
Is there a way to load the animation without blocking main UI thread (but preferably showing a custom loader)?
Steps to Reproduce:
Environment Details:
Platform: iOS
Lottie Version: 4.5.1, also tested on almost every 4.x.x version...
Beta Was this translation helpful? Give feedback.
All reactions