title: When using [UIViewControllerTransitionCoordinator animateAlongsideTransition:completion:] in a modal presentation, the animation block is not called
body: <p>I have a <code>UIViewController</code> that is being presented via a modal segue in a storyboard (embedded in a <code>UINavigationController</code>). I'm trying to animate the keyboard appearance alongside the modal presentation (logic for this is beyond the scope of the question).</p>
  
  <p>I'm using <code>[self.transitionCoordinator animateAlongsideTransition:completion:]</code> in <code>viewWillAppear:</code> to do this but I'm noticing that that the animation block is never being called. So a bit of logging has led me to see that the <em>only time</em> the animation block is called on a <em>newly created</em> modal view controller is during <code>viewDidLoad:</code>.</p>
  
  <pre><code>@implementation MyModalViewController
  
  - (void)viewDidLoad {
      NSLog(@"%s", __PRETTY_FUNCTION__);
      [super viewDidLoad];
  
      [self.transitionCoordinator animateAlongsideTransition:^ (id &lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
          NSLog(@"%s ANIMATION", __PRETTY_FUNCTION__);
      } completion:^ (id &lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
          NSLog(@"%s COMPLETION", __PRETTY_FUNCTION__);
      }];
  }
  
  - (void)viewWillAppear:(BOOL)animated {
      NSLog(@"%s", __PRETTY_FUNCTION__);
      [super viewWillAppear:animated];
  
      [self.transitionCoordinator animateAlongsideTransition:^ (id &lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
          NSLog(@"%s ANIMATION", __PRETTY_FUNCTION__);
      } completion:^ (id &lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
          NSLog(@"%s COMPLETION", __PRETTY_FUNCTION__);
      }];
  }
  
  - (void)viewWillDisappear:(BOOL)animated {
      NSLog(@"%s", __PRETTY_FUNCTION__);
      [super viewWillDisappear:animated];
  
      [self.transitionCoordinator animateAlongsideTransition:^ (id &lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
          NSLog(@"%s ANIMATION", __PRETTY_FUNCTION__);
      } completion:^ (id &lt;UIViewControllerTransitionCoordinatorContext&gt; context) {
          NSLog(@"%s COMPLETION", __PRETTY_FUNCTION__);
      }];
  }
  
  @end
  </code></pre>
  
  <p>The output of a modal presentation of this controller is:</p>
  
  <pre><code>SampleAnimatedTransition[43690:1768171] -[MyModalViewController viewDidLoad]
  SampleAnimatedTransition[43690:1768171] __36-[MyModalViewController viewDidLoad]_block_invoke ANIMATION
  SampleAnimatedTransition[43690:1768171] -[MyModalViewController viewWillAppear:]
  SampleAnimatedTransition[43690:1768171] __36-[MyModalViewController viewDidLoad]_block_invoke_2 COMPLETION
  SampleAnimatedTransition[43690:1768171] __40-[MyModalViewController viewWillAppear:]_block_invoke_2 COMPLETION
  </code></pre>
  
  <p>but during dismissal the output is:</p>
  
  <pre><code>SampleAnimatedTransition[43690:1768171] -[MyModalViewController viewWillDisappear:]
  SampleAnimatedTransition[43690:1768171] __43-[MyModalViewController viewWillDisappear:]_block_invoke ANIMATION
  SampleAnimatedTransition[43690:1768171] __43-[MyModalViewController viewWillDisappear:]_block_invoke_2 COMPLETION
  </code></pre>
  
  <p>Notice how the animation block is not called in <code>viewWillAppear:</code>, and even more <strong>annoyingly</strong> the animation block from <code>viewDidLoad:</code> is called before <code>viewWillAppear:</code> is called at all.</p>
  
  <p>Can anyone help me get the animation block is <code>viewWillAppear:</code> to be called?</p>
  
  <p>Note that when I push another view controller onto the navigation controller and hit back, the animation block in <code>viewWillAppear:</code> <em>is</em> called.</p>
  
  <p>I made a <a href="https://dl.dropboxusercontent.com/u/565759/SampleAnimatedTransition_withpush.zip" rel="nofollow">Sample Project</a> if it helps.</p>
  
  <h2>Update</h2>
  
  <p>This has been filed as <a href="http://openradar.appspot.com/radar?id=5788623576236032" rel="nofollow">rdar://20171073</a></p>