title: How to reverse a UIVIew animation on second uibutton press?
body: <p>I have a method that drops down a <code>UIView</code>. That works fine. How would I go about having it slide back up when the button is touched a second time?</p>
  
  <p>I also need to deactivate it somehow so that it doesn't repeat the animation if it's already displayed.</p>
  
  <pre><code>- (void)slideDownTableView {
  
      self.tableViewCities = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
  
      self.tableViewCities.frame = CGRectMake(0,0,300,180);
      self.tableViewCities.autoresizingMask = ( UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth );
      self.tableViewCities.dataSource = self;
      self.tableViewCities.delegate = self;
      self.tableViewCities.backgroundColor = [UIColor whiteColor];
  
  
      UIView *myview=[[UIView alloc] initWithFrame: CGRectMake(10, 0,300,180)];
      myview.backgroundColor=[UIColor redColor];
  
      [myview addSubview:self.tableViewCities];
  
      [self.view addSubview:myview];
      myview.frame = CGRectMake(10, 0,300,-180); // offscreen
  
          [UIView animateWithDuration:0.5
                           animations:^{
                               myview.frame = CGRectMake(10, 0,300,180); // final location move
                           }];
  }
  </code></pre>