How airbnb/lottie-ios works
Lottie for iOS is a Swift library that decodes Bodymovin animation data and renders it in native views. The main workflow is to load JSON (or a .lottie archive), configure playback and providers, select a rendering engine, then display and control the animation. Its rendering branches include Core Animation and a main-thread node renderer; runtime keypath/value overrides, text and image assets, controls, and caches are additional capabilities. Edges follow explicit README statements or SOURCE INDEX references; unsampled subsystem links are omitted where their callers are not evidenced.
Main entry points: LottieAnimationLayer.swift Playback layer · LottieAnimationView.swift Animation view · RootAnimationLayer.swift Root layer · CoreAnimationLayer.swift Core Animation
Components 23
Public API
- Animation view
Sources/Public/Animation/LottieAnimationView.swift - SwiftUI view
Sources/Public/Animation/LottieView.swift - Configuration
Sources/Public/Configuration/LottieConfiguration.swift - Animated controls
Sources/Public/Controls/AnimatedControl.swift - Logger
Sources/Public/Logging/LottieLogger.swift
Animation Inputs
- Animation model
Sources/Public/Animation/LottieAnimation.swift - DotLottie file
Sources/Public/DotLottie/DotLottieFile.swift - Layer and shape models
Sources/Private/Model/Layers
Playback Control
- Playback layer
Sources/Public/Animation/LottieAnimationLayer.swift - Playback context
Sources/Private/Utility/Helpers/AnimationContext.swift
Rendering Engines
- Root layer
Sources/Private/RootAnimationLayer.swift - Engine compatibility
Sources/Private/CoreAnimation/CompatibilityTracker.swift - Core Animation
Sources/Private/CoreAnimation/CoreAnimationLayer.swift - Main-thread renderer
Sources/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift - Shape node system
Sources/Private/MainThread/NodeRenderSystem
Runtime Extensions
- Animation cache
Sources/Public/AnimationCache/DefaultAnimationCache.swift - Keypath overrides
Sources/Public/DynamicProperties/AnimationKeypath.swift - Value providers
Sources/Public/DynamicProperties/AnyValueProvider.swift - Image provider
Sources/Public/ImageProvider/AnimationImageProvider.swift - Bundle images
Sources/Public/iOS/BundleImageProvider.swift - Text provider
Sources/Public/TextProvider/AnimationTextProvider.swift - Font provider
Sources/Public/FontProvider/AnimationFontProvider.swift
Other components
- App developer
Connections 23
- App developer → Animation view: creates view
README.md - App developer → SwiftUI view: embeds animation
README.md - Animation view → Playback layer: manages playback
Sources/Public/Animation/LottieAnimationLayer.swift - Animation view → Animation model: loads model
Sources/Public/Animation/LottieAnimationView.swift - DotLottie file → Animation model: contains animations
Sources/Public/DotLottie/DotLottieFile.swift - Animation view → DotLottie file: loads archive
Sources/Public/Animation/LottieAnimationView.swift - Animation view → Configuration: uses settings
Sources/Public/Animation/LottieAnimationView.swift - Playback layer → Playback context: creates context
Sources/Private/Utility/Helpers/AnimationContext.swift - Playback layer → Root layer: selects renderer
Sources/Public/Animation/LottieAnimationLayer.swift - Playback layer → Core Animation: configures engine
Sources/Public/Animation/LottieAnimationLayer.swift - Playback layer → Main-thread renderer: configures engine
Sources/Public/Animation/LottieAnimationLayer.swift - Core Animation → Engine compatibility: reports issues
Sources/Private/CoreAnimation/CoreAnimationLayer.swift - Core Animation → Layer and shape models: builds layer hierarchy
Sources/Private/CoreAnimation/CoreAnimationLayer.swift - Main-thread renderer → Shape node system: renders shapes
Sources/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift - Playback layer → Keypath overrides: searches properties
Sources/Public/Animation/LottieAnimationLayer.swift - Playback layer → Value providers: sets overrides
Sources/Public/Animation/LottieAnimationLayer.swift - Root layer → Image provider: provides images
Sources/Private/RootAnimationLayer.swift - Bundle images → Image provider: implements provider
Sources/Public/iOS/BundleImageProvider.swift - Root layer → Font provider: provides fonts
Sources/Private/RootAnimationLayer.swift - Root layer → Text provider: provides text
- Animated controls → Playback layer: controls playback
- Animation view → Animation cache: uses cache
- Image provider → Logger: logs warnings
Sources/Public/iOS/BundleImageProvider.swift