title: Custom UIViewController transitions with animateWithDuration in Swift
body: <p>So... Truth is, I've been navigating through the documentation almost blindly. I really don't understand why there's no sample code illustrating how to use certain methods. But yeah, enough whining from me.</p>
  
  <p>I have a view controller that conforms to UIViewControllerTransitioningDelegate and UIViewControllerAnimatedTransitioning. I have a few animations (using facebook pop) that essentially slide certain elements of the view out. After these animations complete I want to transition to the next view controller.</p>
  
  <p>I have overridden prepareForSegue like so:</p>
  
  <pre><code>override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
  
        self.transitioningDelegate = self;
  
        let targetViewController = self.storyboard.instantiateViewControllerWithIdentifier("chooseSigilViewController") as UIViewController;
  
        self.presentViewController(targetViewController, animated: true, completion: nil);
  
        // slide out ui elements in the current UIViewController
        slideLabelsOut(greetingsLabel, nameUtilityLabel);
        slideTextFieldOut(inputPlayerNameTextField);
        slideProceedButtonOut(sender as UIButton); }
  </code></pre>
  
  <p>I than set up the transition duration and the actual animation... what I have problem with is this line:</p>
  
  <pre><code>UIView.animateWithDuration(self.transitionDuration(transitionContext), animations: &lt;#(() -&gt; Void)?#&gt;, completion: &lt;#((Bool) -&gt; Void)?#&gt;)
  </code></pre>
  
  <p>How do I setup my code within the animations: and completion: arguments.</p>
  
  <p>I've seen this used in Obj-C code:</p>
  
  <pre><code>^{ // code goes here }
  </code></pre>
  
  <p>I've tried it that way, it didn't work. Also it felt really awkward as I don't really know what that "^" even does?</p>