title: How insert multiple custom cells (one for each xib file) in multiple sections in a TableviewController in Swift?
body: <pre><code>struct Objects{
      var section: String! //Section name
      var cellIndex: [String] //cell index
  }
  var objects = [Objects]()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      objects = [Objects(section: "Profile", cellIndex: ["name", "gender"]), Objects(section: "Change Login", cellIndex: ["changeLogin"])]
  }
   override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
      return objects.count
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int{
      return objects[section].cellIndex.count
  }
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath:NSIndexPath) -&gt; UITableViewCell {
      if objects[indexPath.row].cellIndex == "name" {
          let cell = tableView.dequeueReusableCellWithIdentifier("profileNameCell") as!ProfileNameCell
          return cell
      }else
      if objects[indexPath.row].cellIndex == "gender" {
          let cell = tableView.dequeueReusableCellWithIdentifier("profileGenderCell") as!ProfileGenderCell
          return cell
      }else{
      objects[indexPath.row].cellIndex == "changeLogin" {
          let cell = tableView.dequeueReusableCellWithIdentifier("profileChangeLoginCell") as!ProfileChangeLoginCell
          return cell
      }
  </code></pre>
  
  <p>Each "ProfileNameCell", "ProfileNameCell", "ProfileChangeLoginCell" is connected to a xib file.</p>
  
  <p>The code above don't compile. 
  I read code examples and I tried to go further on my code, but I don't know how insert the sections. </p>
  
  <p>Advices? Thank you very much. </p>
  
  <p>EDIT:</p>
  
  <p>I decided to create the cells directly in the table view, like Vadian said, and it worked. 
  I had tried it before but the cells components had not connected to UiTableViewController. Because of this problem I had decided using xib files. Now the elements are connecting. To show all the cells and sections I used the code below:</p>
  
  <pre><code>struct Cells{
      var section: String!
      var rows: [String]!
  }
  var tableStructure: [Cells] = []
  
  override func viewDidLoad() {
      super.viewDidLoad(
      tableStructure = [Cells(section: "One", rows: ["1", "2", "3", "4", "5"]), Cells(section: "Two", rows: ["1"]), Cells(section: "Three", rows: ["1", "2"])]
  }
  
  
  override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
      return tableStructure.count
  }
  
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return tableStructure[section].rows.count
  }  
  </code></pre>