diff --git a/Sources/Public/Animation/LottieView.swift b/Sources/Public/Animation/LottieView.swift index 3ac2b25754..8092be2f10 100644 --- a/Sources/Public/Animation/LottieView.swift +++ b/Sources/Public/Animation/LottieView.swift @@ -175,11 +175,22 @@ public struct LottieView: UIViewConfiguringSwiftUIView { return copy } - /// Returns a copy of this view that loops its animation whenever visible + // Returns a copy of this view playing once from the current frame to the end frame + public func play() -> Self { + play(loopMode: .playOnce) + } + + /// Returns a copy of this view that loops its animation from the start to end whenever visible public func looping() -> Self { play(.fromProgress(0, toProgress: 1, loopMode: .loop)) } + /// Returns a copy of this view playing from the current frame to the end frame, + /// with the given `LottiePlaybackMode`. + public func play(loopMode: LottieLoopMode = .playOnce) -> Self { + play(.toProgress(1, loopMode: loopMode)) + } + /// Returns a copy of this view playing with the given `LottiePlaybackMode` public func play(_ playbackMode: LottiePlaybackMode) -> Self { self.playbackMode(playbackMode)