title: Multiple Sections In UITableView Swift 4
body: <p>Well, I am trying to make a registration form. My problem is that in the section cell doesn't show the correct info into the sections, it shows all the info in the sections... ermm I think something I missed on the cell for row. </p>
  
  <p>So, my code would look something like this.</p>
  
  <p><strong>UITableViewDataSource</strong> </p>
  
  <pre><code>extension IEKRegistrationPage3Controller: UITableViewDataSource {
  
  func numberOfSections(in tableView: UITableView) -&gt; Int {
      return 3
  }
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return 10
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCell(withIdentifier: "IEKRegistrationPage3GraduateCell", for: indexPath) as! IEKRegistrationPage3GraduateCell
  
      // Graduate
      if let graduate = Graduate(rawValue: indexPath.row) {
          cell.updateLayout(withTitle: graduate.description, isSelected: [graduate] == iekRegistrationFormData.graduate)
          }
  
      if let student = Student.init(rawValue: indexPath.row) {
          cell.updateLayout(withTitle: student.description, isSelected: [student] == iekRegistrationFormData.student)
      }
  
      return cell
      }
  }
  </code></pre>
  
  <p>Also here is the <strong>UITableViewDelegate</strong></p>
  
  <pre><code>extension IEKRegistrationPage3Controller: UITableViewDelegate {
  
  func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
      // Graduate
      tableView.deselectRow(at: indexPath, animated: true)
      if indexPath.section == 0 {
          if let graduate = Graduate(rawValue: indexPath.row) {
              iekRegistrationFormData.graduate = [graduate]
          }
      }
  
      // Student
      tableView.deselectRow(at: indexPath, animated: true)
      if indexPath.section == 1 {
          if let student = Student(rawValue: indexPath.row) {
              iekRegistrationFormData.student = [student]
          }
      }
  
      // Engilsh
      tableView.deselectRow(at: indexPath, animated: true)
      if indexPath.section == 2 {
          // TODO
      }
       tableView.reloadData()
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and finally the <strong>titleForHeaderInSection</strong> </p>
  
  <pre><code>func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -&gt; String? {
      // Graduate
      if section == 0 {
          return "ΑΠΟΦΟΙΤΟΣ"
      }
  
      // Student
      if section == 1 {
          return "ΦΟΙΤΗΤΗΣ"
      }
  
      // Engilsh
      if section == 2 {
          return "ΑΓΓΛΙΚΑ"
      }
      return nil
  }
  </code></pre>