title: obtain data from UITextField in UITableViewCell
body: <p>I have crated this tableview to obtain the users children's names and store them into an array called <code>dependentsArray</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/BBHR7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BBHR7.png" alt="enter image description here"></a></p>
  
  <p>I have searched through stackoverflow, Apple documentation, google, and youtube tutorials, and cant seem to find a solution. This seems like it should be simple but its causing quite the headache. The closest i found to a solution was this post:</p>
  
  <p><a href="https://stackoverflow.com/questions/28431086/getting-data-from-each-uitableview-cells-swift">getting data from each UITableView Cells Swift</a></p>
  
  <p>However, i am not obtaining the cells textfield value by tapping them, so i cannot use <code>didDeselectRowAtIndexPath</code>. I wish to obtain the text values when i tap the "Next" button.</p>
  
  <p>The tableview expands and contracts its cell count based on an integer called <code>dependentsCount</code>. I increment and decrement the <code>dependentsCount</code> like so: </p>
  
  <pre><code>    @IBAction func subtractDependentButtonClick(sender: AnyObject) {
      dependentsCount -= 1
      dependentsTableView.reloadData()
      fadeTransition(0.3)
  }
  
  @IBAction func addDependentButtonClick(sender: AnyObject) {
      dependentsCount += 1
      dependentsTableView.reloadData()
      fadeTransition(0.3)
  }
  </code></pre>
  
  <p>The ways in which ive tried to obtain the value of text fields are as follows:</p>
  
  <pre><code>    @IBAction func nextButtonPress(sender: AnyObject) {
      var index = 0
      var cell = self.dependentsTableView.cellForRowAtIndexPath(NSIndexPath(index: index)) as! DependentsTableViewCell
  
      while index &lt; dependentsCount
      {
          self.dependentsArray.append(cell.nameTextField.text!)
          index += 1
      }
      self.performSegueWithIdentifier("showNextVC", sender: nil)
  
  }
  </code></pre>
  
  <p>which crashed the app ^^</p>
  
  <pre><code>    func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
      let cell = dependentsTableView.dequeueReusableCellWithIdentifier("Cell") as! DependentsTableViewCell
      dependentsArray.append(cell.nameTextField.text!)
      print("\(dependentsArray)")
  }
  </code></pre>
  
  <p>which does nothing ^^</p>
  
  <p><strong>what is the correct way to obtain tableview cell's textfield text?</strong></p>