title: Expand and Collapse View in iOS App smoothly?
body: <p>I have an UIView inside a <strong>UIViewController</strong>. I want to expand that <strong>UIView</strong> and collapse. This feature is same as in iOS OS we drag View from Top, but in iOS it comes upon whole of App but I want to put this inside <strong>UIViewController</strong>.</p>
  
  <p>LIKE THIS </p>
  
  <p><img src="https://i.stack.imgur.com/Imt2z.png" alt="enter image description here"></p>
  
  <p>I have tried Expand and Collapse, but resizing Frame size but I am unable to Drag it and again up.</p>
  
  <p>What I did is.</p>
  
  <pre><code>- (IBAction)expandCollapseView:(UIButton *)sender {
      NSLog(@"Hello");
  
  
      if (!_isExpended) {
          NSLog(@"IF ");
  
          _isExpended = YES;
  
          [UIView beginAnimations:@"animationOff" context:NULL];
          [UIView setAnimationDuration:1.3f];
          [_expandableView setFrame:CGRectMake(0, 0, 768, 40)];
          [UIView commitAnimations];
      } else {
          NSLog(@"ELSE");
          _isExpended = NO;
  
          [UIView beginAnimations:@"animationOff" context:NULL];
          [UIView setAnimationDuration:1.3f];
          [_expandableView setFrame:CGRectMake(0, 0, 768, 489)];
          [UIView commitAnimations];
      }
  
  
  
  }
  </code></pre>
  
  <p>//But this code is useless in my sense. as I can't expand, or also resize issue in AutoLayout, so have to remove it.</p>
  
  <p>I need it like below...</p>
  
  <p><img src="https://i.stack.imgur.com/pSQJ8.png" alt="enter image description here"></p>
  
  <p>Thanks</p>