title: Animation: continuous heartbeat monitor lines
body: <p>I have an image of what symbolises a heartbeat </p>
  
  <p><img src="https://i.stack.imgur.com/QREcU.png" alt="heartbeat"> </p>
  
  <p>and I'm trying to loop it in my subview so it continuously appears on my view if you understand what i mean. So far I have got it to appear and move across infinitely on my subview however it isn't continuous as it only appears again from the left after it has completely gone out of the view on the right where as I want it to appear again as soon as it has completely entered the view so it symbolises an actual heartbeat. My code looks something like this on my <code>viewDidLoad</code>:</p>
  
  <pre><code>self.heartbeatLoading.frame.origin = CGPoint(x: 0 - heartbeatLoading.frame.size.width, y: 10)    
  let animation: UIViewAnimationOptions = [.repeat, .curveLinear]
  
  UIView.animate(withDuration: 5.0, delay: 0, options: animation, animations: {
          self.heartbeatLoading.frame = self.heartbeatLoading.frame.offsetBy(dx: self.view.frame.width + self.heartbeatLoading.frame.width, dy: 0.0)
  }, completion: nil)
  </code></pre>