diff --git a/Sources/DotLottie/Public/DotLottieAnimation.swift b/Sources/DotLottie/Public/DotLottieAnimation.swift index 473b2cf..d0e6276 100644 --- a/Sources/DotLottie/Public/DotLottieAnimation.swift +++ b/Sources/DotLottie/Public/DotLottieAnimation.swift @@ -71,6 +71,18 @@ public final class DotLottieAnimation: ObservableObject { } } + /// Load a .lottie file from Data. + public convenience init( + dotLottieData: Data, + config: AnimationConfig + ) { + self.init(config: config) { + try $0.loadDotLottie(data: dotLottieData) + } errorMessage: { error in + "Failed to load dotLottie. Failed with error: \(error)" + } + } + @_disfavoredOverload @available(*, deprecated) public convenience init(