Repository: airbnb/lottie-ios
File: Sources/Public/Animation/LottieView.swift (Swift)

Code before:
    playbackMode(.play(.fromProgress(nil, toProgress: 1, loopMode: loopMode)))
  }

  @available(*, deprecated, renamed: "playbackMode(_:)", message: "Will be removed in a future major release.")
  public func play(_ playbackMode: LottiePlaybackMode) -> Self {
    self.playbackMode(playbackMode)
  }

  /// Returns a copy of this view playing with the given playback mode
  public func playing(
    _ playbackMode: LottiePlaybackMode
      .PlaybackMode = .fromProgress(nil, toProgress: 1, loopMode: .playOnce))
    -> Self
  {
    self.playbackMode(.play(playbackMode))
  }

  /// Returns a copy of this view playing from the current frame to the end frame,
  /// with the given `LottiePlaybackMode`.
  public func playing(loopMode: LottieLoopMode = .playOnce) -> Self {
    playbackMode(.play(.fromProgress(nil, toProgress: 1, loopMode: loopMode)))
  }

  // Returns a copy of this view playing once from the current frame to the end frame
  public func playing() -> Self {
    playbackMode(.play(.fromProgress(nil, toProgress: 1, loopMode: .playOnce)))
  }

  /// Returns a copy of this view paused with the given state
  public func paused(at state: LottiePlaybackMode.PausedState = .currentFrame) -> Self {
    playbackMode(.paused(at: state))
  }

  /// Returns a copy of this view paused with the current frame
  public func paused() -> Self {
    playbackMode(.paused(at: .currentFrame))
  }

  /// Returns a copy of this view using the given `LottiePlaybackMode`
  public func playbackMode(_ playbackMode: LottiePlaybackMode) -> Self {
    var copy = self
    copy.playbackMode = playbackMode
    return copy
  }

  /// Returns a copy of this view with the given closure that is called whenever the
  /// `LottieAnimationSource` provided via `init` is loaded and applied to the underlying `LottieAnimationView`.
  public func animationDidLoad(_ animationDidLoad: @escaping (LottieAnimationSource) -> Void) -> Self {
    var copy = self
    copy.animationDidLoad = animationDidLoad
    return copy

Review comment (suggestion):
Same here -- I think having this be defaulted would make just `paused()` ambigious

```suggestion
  public func paused(at state: LottiePlaybackMode.PausedState) -> Self {
```

Code after:
    playbackMode(.playing(.fromProgress(nil, toProgress: 1, loopMode: loopMode)))
  }

  @available(*, deprecated, renamed: "playbackMode(_:)", message: "Will be removed in a future major release.")
  public func play(_ playbackMode: LottiePlaybackMode) -> Self {
    self.playbackMode(playbackMode)
  }

  /// Returns a copy of this view playing with the given playback mode
  public func playing(_ mode: LottiePlaybackMode.PlaybackMode) -> Self {
    playbackMode(.playing(mode))
  }

  /// Returns a copy of this view playing from the current frame to the end frame,
  /// with the given `LottiePlaybackMode`.
  public func playing(loopMode: LottieLoopMode) -> Self {
    playbackMode(.playing(.fromProgress(nil, toProgress: 1, loopMode: loopMode)))
  }

  // Returns a copy of this view playing once from the current frame to the end frame
  public func playing() -> Self {
    playbackMode(.playing(.fromProgress(nil, toProgress: 1, loopMode: .playOnce)))
  }

  /// Returns a copy of this view paused with the given state
  public func paused(at state: LottiePlaybackMode.PausedState = .currentFrame) -> Self {
    playbackMode(.paused(at: state))
  }

  /// Returns a copy of this view using the given `LottiePlaybackMode`
  public func playbackMode(_ playbackMode: LottiePlaybackMode) -> Self {
    var copy = self
    copy.playbackMode = playbackMode
    return copy
  }

  /// Returns a copy of this view with the given closure that is called whenever the
  /// `LottieAnimationSource` provided via `init` is loaded and applied to the underlying `LottieAnimationView`.
  public func animationDidLoad(_ animationDidLoad: @escaping (LottieAnimationSource) -> Void) -> Self {
    var copy = self
    copy.animationDidLoad = animationDidLoad
    return copy
  }

  /// Returns a copy of this view with the given `LottieCompletionBlock` that is called
  /// when an animation finishes playing.
  public func animationDidFinish(_ animationCompletionHandler: LottieCompletionBlock?) -> Self {
    var copy = self
    copy.animationCompletionHandler = { [previousCompletionHandler = self.animationCompletionHandler] completed in
      previousCompletionHandler?(completed)
      animationCompletionHandler?(completed)