title: how do I remove oringal background color from animation
body: <p>How do I make my animation only use colors in the “colors” array and not use oringal white background as it’s first key frame? Please help</p>
  <p>Any way to skip/delete/ the first key frame which is white.</p>
  <pre><code>
  var color1 = UIColor.purple
  var color2 = UIColor.blue
  var color3 = UIColor.green
  var color4 = UIColor.yellow
  var color5 = UIColor.orange
  
  
  extension UIViewController {
  
  
      func viewDidLoad(){
      
  
      let colors = [color1, color2, color3, color4, color5]
      
      
      
      
      
          let totalDuration = 5.0
     
      let relDuration: CGFloat = 1.0 / CGFloat(colors.count)
     
     var relStartTime: TimeInterval = 0.0
     
      UIView.animateKeyframes(withDuration: totalDuration, delay: 0.0, options: [.repeat, .allowUserInteraction, .autoreverse, .calculationModeCubicPaced], animations: {
         colors.forEach { c in
             UIView.addKeyframe(withRelativeStartTime: relStartTime, relativeDuration: relDuration, animations: {
                 self.view.backgroundColor = c
             })
             relStartTime += relDuration
     }}
                             
     )
  
  
      }
  
  }
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/x9A15.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x9A15.gif" alt="Speed up version of animation showing the pause on the background" /></a></p>