title: Repeat the delay in a UIView animation loop?
body: <p>I'm trying to do a customized animation on view opacity like this:</p>
  
  <ol>
  <li>Delay for 5 seconds; (The view will keep opaque for 5 seconds)</li>
  <li>Animate from opacity value 1 to 0;</li>
  <li>Delay for 5 seconds; (The view will keep transparent for 5 seconds)</li>
  <li>Animate from opacity value 0 to 1;</li>
  </ol>
  
  <p>I want to repeat step 1 to 4 indefinitely: 1, 2, 3, 4, 1, 2, 3, 4,.....</p>
  
  <p>Here is what I tried:</p>
  
  <pre><code>[UIView animateWithDuration:1
                        delay:5
                      options:UIViewAnimationOptionAutoreverse|UIViewAnimationOptionRepeat|UIViewAnimationOptionCurveEaseInOut
                   animations:^{
                       self.imageView.layer.opacity = 0;
                   }
                   completion:nil
   ];
  </code></pre>
  
  <p>But the delay only appeared once at the beginning, what I ended up with is:</p>
  
  <p>1, 2, 4, 2, 4, 2, 4,.....</p>