title: Getting Ordered TextField Data From Dynamically Created Cells in Swift (3.1) Table View
body: <p>I am trying to figure out how to get textfield data from cells in a tableview in an ordered fashion. So far I am able to type into each textfield a retrieve the type data. To do so in the correct order though the user must edit the first cell...last cell, any other way and the data isn't in the correct order.</p>
  
  <p>For Example: </p>
  
  <p>I have the program create 5 cells with a textfield,</p>
  
  <ul>
  <li>textfield1: I typed here second</li>
  <li>textfield2: I typed here fourth</li>
  <li>textfield3: I typed here first</li>
  <li>textfield4: I typed here fifth</li>
  <li>textfield5: I typed here third </li>
  </ul>
  
  <p>the way I currently have it my dataArray would look identical to this one, because it is being stored based on when it is typed in and not the order of the cells.
  I would like to type the above example, but my data come out like this:</p>
  
  <ul>
  <li>textfield1: I typed here first</li>
  <li>textfield2: I typed here second</li>
  <li>textfield3: I typed here third</li>
  <li>textfield4: I typed here fourth</li>
  <li>textfield5: I typed here fifth</li>
  </ul>
  
  <p>Here is my textfield editing code:</p>
  
  <pre><code>@IBAction func TitleEditBegin(_ sender: UITextField) {
  }
  
  @IBAction func TitleEditEnd(_ sender: UITextField) {
      print(sender.tag) // Debug
      titleArray.append(sender.text!)
  }
  </code></pre>
  
  <p>I know for the time being that any other changes will be appended to the titleArray, but I want to solve the ordering issue first.</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:</strong> I forgot to add in how I am creating the cells, the code is below:</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      let cell = TitleSessionTableView.dequeueReusableCell(withIdentifier: textCellIdentifier, for: indexPath) as! TitleSessionCell
  
      cell.SessionTitleLabel.text = "Title"
      // cell.SessionTitleField.text = "Default"
      cell.SessionTitleField.tag = indexPath.row
      cell.SessionTitleField.delegate = self
      print(indexPath.row) // Debug
  
      return cell
  
  }
  </code></pre>
  
  <p><strong>EDIT 2:</strong> Adding where I define the text fields.</p>
  
  <pre><code>import Foundation
  import UIKit
  
  class TitleSessionCell: UITableViewCell{
  
  @IBOutlet weak var SessionTitleField: UITextField!
  @IBOutlet weak var SessionTitleLabel: UILabel!
  
  
  override func awakeFromNib() {
      super.awakeFromNib()
  }
  
  
  }
  </code></pre>