title: How do I change the text of a UILabel between each animation of animateWithDuration with repeat?
body: <p>I have an <code>Array</code> <code>words</code> containing <code>["alice", "bob", "charles"]</code> and a <code>UILabel</code> <code>label</code>. I want <code>label</code> to repeatedly fade in and out, with a different word from <code>words</code> each time. If I put the text-changing code inside the <code>animations</code> block, it doesn’t execute, even though the fading works as expected (the <code>completion</code> block is run only when something stops the repetition):</p>
  
  <pre><code>label.alpha = 0
  
  UIView.animateWithDuration(4, delay: 0, options: .Autoreverse | .Repeat, animations: {
      self.label.text = nextWord()
      self.label.alpha = 1
  }, completion: {_ in
      NSLog("Completed animation")
  })
  </code></pre>
  
  <p>What’s a good way to fix this? Thanks.</p>