title: Header in section
body: <p>I'm trying to copy the header in section, shown in this picture: <img src="https://i.stack.imgur.com/m7H1V.png" alt="SectionHeader"></p>
  
  <p>I' trying to add a label and the separator line inside the same view.
  So far I have this code that isn't working at all...</p>
  
  <pre><code>- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  
      CGRect sepFrame = CGRectMake(0, 50-1, 320, 1);
      UIView *customView = [[UIView alloc] initWithFrame:sepFrame];
      customView.backgroundColor = [UIColor colorWithWhite:224.0/255.0 alpha:1.0];
  
      UILabel *sectionHeader = [[UILabel alloc] initWithFrame:CGRectNull];
      sectionHeader.backgroundColor = [UIColor whiteColor];
      sectionHeader.textAlignment = NSTextAlignmentCenter;
      sectionHeader.font = [UIFont boldSystemFontOfSize:16];
      sectionHeader.textColor = [UIColor colorWithRed:(66/255.0) green:(139/255.0) blue:(18/255.0) alpha:1] ;
      //sectionHeader.text = [NSString stringWithFormat:@"Section %d", section];
  
      switch (section) {
          case 0:
              sectionHeader.text =NSLocalizedString(@"ACTIVO", nil) ;
              [customView addSubview:sectionHeader];
              break;
          case 1:
              sectionHeader.text = NSLocalizedString(@"PASSIVO",nil);
              [customView addSubview:sectionHeader];
              break;
      }
  
      return customView;
  }
  </code></pre>
  
  <p>Any help will be much appreciated since I'm new to IOS, thanks in Advance.</p>