title: How to design the array structure for Multiple cells in UITableview?
body: <p>This is my first <code>ViewController</code> ,when I will click on plus(+) button, it will move to the <code>SecondViewController</code></p>
  
  <p><a href="https://i.stack.imgur.com/8PHcE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8PHcE.png" alt="enter image description here"></a></p>
  
  <p>This is my <code>SecondViewController</code>, after giving the required field when I will click on save button it should add one more row in  my <code>tableview</code> respective cell(executive,seniormanagement,staff). But it's not adding the row in respective cells.</p>
  
  <p><a href="https://i.stack.imgur.com/gDH3T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gDH3T.png" alt="enter image description here"></a></p>
  
  <p>This my code what i have tired</p>
  
  <h2>FirstViewController</h2>
  
  <pre><code>  class TableViewHeader: UIViewController ,UITableViewDelegate,UITableViewDataSource,EmployeeProtocol{
  
   @IBOutlet weak var tableviewHeader: UITableView!
  
  
   var employee = [ EmployeeStatus(status:"Executive",Name:["Smith","Dev","Aryan"], Date:["Nov  14 1889","Dec  01  1980","Sep  18  1997"]),
  
                   EmployeeStatus(status:"SeniorManagement",Name:["Sourav","Smarak"], Date:[" April  10  1879"," Dec  11  1990"]),
  
                   EmployeeStatus(status:"Staff",Name:["Smith","Dev","Aryan","Suman"], Date:["Feb  14 1234"," Jan  01  1480","Sep  23  1994","July  10  1991"])]
  
  @IBAction func plusButtonTapped(_ sender: UIButton) {
      performSegue(withIdentifier: "showSegue", sender:self)
  }
  
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      if segue.identifier == "showSegue" {
          let createSegue = segue.destination as!  CreateEmployeeViewController
  
          createSegue.myEmpProtocol = self
      }
  }
  
  func numberOfSections(in tableView: UITableView) -&gt; Int {
      return employee.count
  }
  
  func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -&gt; CGFloat {
      return 50
  }
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return employee[section].Name.count
  }
  
  func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -&gt; CGFloat {
      return 70
  }
  
  func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? {
      let Label = UILabel()
      Label.text = employee[section].status
      Label.backgroundColor = UIColor.gray
      return Label
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableviewHeader.dequeueReusableCell(withIdentifier: "TableHeaderCell", for: indexPath) as! TableViewHeadercell
      cell.NameLabel.text = employee[indexPath.section].Name[indexPath.row]
      cell.DateLabel.text = employee[indexPath.section].Date[indexPath.row]
      return cell
  }
  
  func addData(status:String, Name:[String], Date:[String]) {
      employee.append(EmployeeStatus(status:status, Name:Name, Date: Date))
      tableviewHeader.reloadData()
  }
  }
  </code></pre>
  
  <h2>SeconViewController</h2>
  
  <pre><code>    protocol EmployeeProtocol {
          func addData(status:String, Name:[String], Date:[String])
         }
  
     class CreateEmployeeViewController: UIViewController {
  
      var myEmpProtocol:EmployeeProtocol?
  
  
  @IBOutlet weak var nameTextField: UITextField!
  
  @IBOutlet weak var birthdayTextField: UITextField!
  
  @IBOutlet weak var StatusSegment: UISegmentedControl!
  
  
  var name  = [String]()
  var DOB = [String]()
  var status:String = ""
  
  @IBAction func saveButtonTapped(_ sender: UIButton) {
      self.name = [nameTextField.text!]
      self.DOB = [birthdayTextField.text!]
      if StatusSegment.selectedSegmentIndex == 0 {
          self.status = "Executive"
      } else if StatusSegment.selectedSegmentIndex == 1{
          self.status = "SeniorManagement"
      }  else if StatusSegment.selectedSegmentIndex == 2 {
          self.status = "Staff"
      }
      myEmpProtocol?.addData(status:status, Name:name, Date:DOB)
  
  }
  
  @IBAction func CancelButtonTapped(_ sender: UIButton) {
      dismiss(animated: true, completion: nil)
  }
  
  }
  </code></pre>
  
  <h2>MyClass</h2>
  
  <pre><code> import Foundation
    struct EmployeeStatus {
     var status:String
     var Name:[String]
     var Date:[String]
   init(status:String, Name:[String], Date:[String]){
      self.status = status
      self.Name = Name
      self.Date = Date
     }
  </code></pre>