title: Functions chain with delays in swift
body: <p>I'm wondering how it is possible to chain a sequence of <code>UIView.animationWithDuration:completion:</code> functions to perform each next function from completion closure of previous animationWithDuration. So I should have something like:</p>
  
  <pre><code>finalAnimation &lt;&lt;&lt; animationB &lt;&lt;&lt; animationA &lt;&lt;&lt; initialValues()
  </code></pre>
  
  <p>It's easy to chain them if functions doesn't have any time delay inside. Also it's easy to build a queue of animations with a shared object that contains queue items. But it's not clear how to build such queue without sharing anything but just chaining <code>animationWithDuration:completion:</code>
  Thanks for your advice</p>