title: A better way to animate resizing of UIView and subviews?
body: <p>Example screen capture:</p>
  
  <p><img src="https://i.stack.imgur.com/CyOQi.gif" alt="http://i.stack.imgur.com/CyOQi.gif"></p>
  
  <p>What is a better way to animate the resizing of a UIView that includes subviews?</p>
  
  <p>My current method:</p>
  
  <p>In the screen capture, the parent UIView (orange) has a subview UILabel (yellow + autoresizing). <code>animateWithDuration</code> is animating the resizing of the parent UIView's frame. The problem with this method is it does not animate the resizing of the subview. It abruptly changes, where it should scale animatedly.</p>
  
  <p>Is explicitly animating the subview best, or is there a more efficient method? (e.g. CGAffineTransform?)</p>
  
  <p><strong>Sample code:</strong></p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
  
      self.parentView = [[UIView alloc] initWithFrame:CGRectMake(10, 100, 200, 200)];
      self.parentView.backgroundColor = [UIColor orangeColor];
      [self.view addSubview:self.parentView];
  
      self.childLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 180, 180)];
      self.childLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth |
                                       UIViewAutoresizingFlexibleHeight;
      self.childLabel.backgroundColor = [UIColor yellowColor];
      [self.parentView addSubview:self.childLabel];
  
      [NSTimer scheduledTimerWithTimeInterval:2
                                       target:self
                                     selector:@selector(randomizeParentViewSize)
                                     userInfo:nil
                                      repeats:YES];
  }
  
  - (void)randomizeParentViewSize {
      CGFloat width = arc4random_uniform(100) + 50;
      CGFloat height = arc4random_uniform(100) + 50;
  
      [UIView animateWithDuration:1.5f
                            delay:0.0f
                          options:0
                       animations:^{
                           self.parentView.frame = CGRectMake(10, 50 + height, width, height);
                       }
                       completion:^(BOOL finished) {
                       }];
  }
  </code></pre>