title: how to change a particular header section height of uitableview dynamically in ios
body: <p>I have an UITableView where in the header part there are multiple headerSection available. The default height is <strong>56</strong>. Now I want to change a particular headerSection height to <strong>40</strong> whenever I click on the particular section's button. the click triggers a method<code>(sectionOpened:)</code> which helps to change the height. But at that time, the other headerSection's height should remain <strong>56</strong>. How do I do that? My attempt so far: 
  should</p>
  
  <pre><code>float headerSectionHeightDefault;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      headerSectionHeightDefault=56;
  }
  
  - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
      return headerSectionHeightDefault;
  }
  
  
  - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  {
      headerView = [[UIView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 640.0f, 0.0f)];
  
      UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(15, 0, 300, 40)];
      img.image = [UIImage imageNamed:@"menu_btn7.png"];
  
      [headerView addSubview:img];
  
      return headerView;
  }
  
  - (void) sectionOpened : (NSInteger) section
  {
      [menulistTable beginUpdates];
  
      if(section==0)
      {
          headerSectionHeightDefault=40;
      }
      else
      {
          headerSectionHeightDefault=56;
      }
  
      [menulistTable endUpdates];
      self.openSectionIndex = section;
  }
  </code></pre>