title: Setting constraints on Lottie animation- swift
body: <p>I am new to coding in swift (and new to coding in general) - and struggling with applying constraints to <code>Lottie</code> animation.</p>
  
  <p>I was able to get it to center on the screen, but can't get the animation frame to change its size according to the screen size keeping it's aspect ratio.</p>
  
  <p>At the moment the size is 250x250 but I was hoping to get it to resize according to the screen size. Any help will be much appreciated. </p>
  
  <pre><code> override func viewDidLoad() {
      super.viewDidLoad()
      let animationView = LOTAnimationView(name: "clock")
      animationView.frame = CGRect(x: self.view.frame.width / 2 - 125, y: self.view.frame.height / 2 - 125, width: 250, height: 250)
      animationView.contentMode = .scaleAspectFill
      animationView.loopAnimation = true
      self.view.addSubview(animationView)
      view.sendSubviewToBack(animationView)
      animationView.play()
  }
  </code></pre>