title: Custom progress bar animation in ios swift
body: <p>I'm trying to make a progress bar through UIView consisting of an image with 3 colors, i want the progress bar to move right and reappear from the left border of the screen smoothly. till now i have successfully animated the view, it is moving right and when it reaches the border it disappears and reappears from the left. but i want it to completely go across the right border and keep reappearing from the left at the same time, like if half of the view is gone across the right border, it should have reappeared from the left border at the same instance. </p>
  
  <p>this is what i'm trying.</p>
  
  <pre><code>CustomProgressView.frame = CGRect(x: 0, y: 480, width: 100, height: 20)
  
   UIView.animate(withDuration: 2.0, delay: 0, options: [.repeat, .curveEaseOut], animations: {
  
          //self.CustomProgressView.frame = CGRect(x: 420, y: 480, width: 100, height: 20)
            self.CustomProgressView.frame = CGRect(x: 420 , y: 480, width: self.CustomProgressView.frame.size.width,height: self.CustomProgressView.frame.size.height)
  
      }, completion: nil)
  </code></pre>