title: How do I play and auto reverse a Lottie animation just once?
body: <p>I am currently trying to use the Lottie framework for adding an animation to my app. My code is as follows:</p>
  
  <pre><code>    override func viewDidLoad() {
          super.viewDidLoad()
          view.backgroundColor = .lightGray
          let starAnimationView = AnimationView()
          // The JSON file
          let starAnimation = Animation.named("qz-checklist-eve")
          starAnimationView.animation = starAnimation
          starAnimationView.frame = CGRect(x: 0, y: 0, width: 400, height: 400)
          starAnimationView.center = self.view.center
          starAnimationView.contentMode = .scaleAspectFill
          view.addSubview(starAnimationView)
          starAnimationView.loopMode = .autoReverse
          starAnimationView.play()
      }
  </code></pre>
  
  <p>This works however the animation continuously loops. I can't seem to find how to set it to a single animation. I have checked the Lottie docs and it says:</p>
  
  <p><code>var AnimationView.loopMode: LottieLoopMode { get set }</code></p>
  
  <blockquote>
    <p>Sets the loop behavior for <code>play</code> calls. Defaults to <code>playOnce</code> Options: : <strong>playOnce</strong>: Animation is played once then stops. : <strong>loop</strong>: Animation will loop from end to beginning until stopped. : <strong>autoReverse</strong>: Animation will play forward, then backwards and loop until stopped. : <strong>repeat(amount)</strong>: Animation will loop from end to beginning up to amount of times. : <strong>repeatBackwards(amount)</strong>: Animation will play forward, then backwards a amount of times. #</p>
  </blockquote>
  
  <p>There is <strong>not</strong> a <code>.repeatBackwards(amount)</code> option. Does anyone know how to get this to work?</p>