title: iOS - Subview not Animating with Frame Change
body: <p>I have a view for which I'm trying to animate a height change when the keyboard slides up (code shown below). The view on which I'm calling the frame change is animating perfectly; however, That view contains a subview, which in turn contains a textfield (which is causing the keyboard to pop up), and these subviews are just jumping to their new locations instead of animating. I put auto layout constraints on the subview to constrain it to the left, bottom and right of the superview as well as maintain a constant height.</p>
  
  <p>Example video here: <a href="http://youtu.be/EmcZ-cXeTbM" rel="nofollow">http://youtu.be/EmcZ-cXeTbM</a></p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (void)viewDidLoad {
      [super viewDidLoad];
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slideViewForKeyboard:) name:UIKeyboardWillShowNotification object:nil];
      [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(slideViewForKeyboard:) name:UIKeyboardWillHideNotification object:nil];
  }
  - (void)slideViewForKeyboard:(NSNotification *)note {
      NSDictionary* userInfo = [note userInfo];
  
      // Get animation info from userInfo
      NSTimeInterval animationDuration;
      UIViewAnimationCurve animationCurve;    
      CGRect keyboardEndFrame;
  
      [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&amp;animationCurve];
      [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&amp;animationDuration];
      [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] getValue:&amp;keyboardEndFrame];
  
      CGRect newFrame = CGRectMake(self.view.frame.origin.x,
                                   self.view.frame.origin.y,
                                   self.view.frame.size.width,
                                   keyboardEndFrame.origin.y);
  
      [UIView animateWithDuration:0 delay:0 options:(animationCurve &lt;&lt; 16) animations:^{
          [self.view setFrame:newFrame];
      }completion:^(BOOL completed){}];
  }
  - (IBAction)endEditingOnTap:(UITapGestureRecognizer *)sender {
      [self.view endEditing:YES];
  }
  
  @end
  </code></pre>