$ show airbnb/lottie-ios
Lottie-ios is a high-performance Swift library for rendering Lottie animations (After Effects exports) natively on Apple platforms (iOS, macOS, tvOS, visionOS). It provides two rendering engines: a full-featured Main Thread engine and a GPU-accelerated Core Animation engine, with automatic fallback based on feature compatibility. The library offers UIKit (LottieAnimationView) and SwiftUI (LottieView) wrappers, interactive controls (AnimatedButton, AnimatedSwitch), dynamic property overrides via a value provider system, and support for the .lottie compressed archive format. It includes embedded, reusable libraries for ZIP archive handling (ZipFoundation), declarative UI model configuration (EpoxyCore), and LRU caching. The codebase is well-structured with extensive test coverage including snapshot tests, keypath logging, and performance benchmarks, and is actively maintained by Airbnb.
The LLM identified 5 files worth highlighting for reuse:
Provides a declarative property system for UI models with key-path identification and update strategies. Self-contained and reusable for any SwiftUI model configuration, demonstrating a clean separation of concerns and type-safe property definitions.
Full-featured ZIP archive reading/writing with support for in-memory archives, ZIP64 extensions, and compression (zlib/Apple Compression). This embedded library is self-contained and can be extracted for any Swift project needing robust ZIP handling without external dependencies.
Generic thread-safe LRU cache with configurable cost limits and memory-pressure observation. Demonstrates careful concurrency handling and can be reused as a standalone caching component in any Swift application.
Interpolates keyframe values using cubic bezier timing curves and spatial tangents, supporting hold, linear, and eased transitions. This module encapsulates complex interpolation logic and can be reused in any animation or timeline-based system.
Represents bezier paths with support for trimming, corner rounding, and conversion to CGPath. This self-contained module provides essential vector graphics operations and can be extracted for use in drawing or geometry libraries.