title: How do I animate the width of a UIView with a Timer?
body: <p>I have a view that's set to the width of my view and a timer that gets some point in the future (in the next 5 minutes). My goal is to animate the view's width from the <code>view.width</code> down to 0 </p>
  
  <p>I was trying to do</p>
  
  <pre><code>UIView.animate(withDuration: date.timeIntervalSinceNow, delay: 0, options: .curveEaseIn, animations: {
      self.countdownBar?.frame = CGRect(x: 0, y:self.view.frame.maxY - 3, width: 0, height: 3)
  }, completion: nil)
  </code></pre>
  
  <p>But this was making the <code>countdownBar</code> animate from the top of the view down to it's <code>maxY</code> position - 3 rather than the width</p>
  
  <p>Any help would be appreciated! </p>
  
  <p><strong>Edit</strong>: Timer code</p>
  
  <pre><code>self.timer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.countdownToCartExpiration), userInfo: nil, repeats: true)
  </code></pre>
  
  <p>And in <code>countdownToCartExpiration</code> I do some UI changes at specific time intervals of minutes and seconds</p>