title: Get all values from tableViewCell from TextFields
body: <p>I want to get all <strong>values</strong> from <code>TableViewCell</code> with <code>TextFields</code>, but i do not understand how i can do it by clicking on button.</p>
  
  <p>And I can add new row if I click on button <code>Add</code>. So i can make as many rows as I want.</p>
  
  <p>My code here:</p>
  
  <pre><code>struct Section {
      let title: String
      var rows: [String]
  }
  
  class SettingsScheduleAndPricesViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate {
  
      var hall: Halls?
  
      var sections = [Section]()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          sections = [Section(title: "Day of week", rows: []),
                      Section(title: "Second section", rows: [""]),
                      Section(title: "Third section", rows: [""])]
      }
  
      // MARK: - TableView
      func numberOfSections(in tableView: UITableView) -&gt; Int {
          return sections.count
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return sections[section].rows.count
      }
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          if indexPath.section == 0 {
              ...
          } else if indexPath.section == 1 {
              let hourlyRateCell = tableView.dequeueReusableCell(withIdentifier: "hourlyRateCell", for: indexPath) as! SettingsHourlyRateCell
              return hourlyRateCell
          } else {
              ...
          }
      }
  
      func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -&gt; String? {
          return sections[section].title
      }
  
      func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -&gt; UIView? {
          let frame: CGRect = tableView.frame
          if section == 0 {
              let headerView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height))
              headerView.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
              return headerView
          } else if section == 1 {
              let addButton: UIButton = UIButton(frame: CGRect(x: frame.size.width - 50, y: 0, width: 50, height: 30))
              addButton.backgroundColor = UIColor.clear
              addButton.setTitleColor(#colorLiteral(red: 0.2588235438, green: 0.7568627596, blue: 0.9686274529, alpha: 1), for: .normal)
              addButton.setTitle(NSLocalizableAdd, for: .normal)
              addButton.addTarget(self, action: #selector(SettingsScheduleAndPricesViewController.addHourlyRate(sender:)), for: .touchUpInside)
              let headerView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height))
              headerView.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
              headerView.addSubview(addButton)
              return headerView
          } else {
              ...
          }
      }
  
      @IBAction func saveBarButtonPressed(_ sender: Any) {
  
          // here I want to get all values from my Cell from my TextFields
  
      }
  
      @objc func addHourlyRate(sender: UIButton) {
          let newRow = ""
          append(row: newRow, in: 1)
      }
  
      func append(row : String, in section: Int) {
          let insertionIndex = sections[section].rows.count
          sections[section].rows.append(row)
          let indexPath = IndexPath(row: insertionIndex, section: section)
          tableView.insertRows(at: [indexPath], with: .automatic)
      }
  }
  
  class SettingsHourlyRateCell: UITableViewCell, UITextFieldDelegate {
      @IBOutlet weak var rubHourTF: UITextField!
  }
  </code></pre>
  
  <p>My example from simulator:</p>
  
  <p><a href="https://i.stack.imgur.com/WgcPTm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WgcPTm.png" alt="enter image description here"></a></p>
  
  <p>In my example me need to get <code>first</code>, <code>second</code> and <code>third</code> string texts from three rows. And append in empty <code>array</code> or just print in <code>console</code>.</p>
  
  <p>In method <code>@IBAction func saveBarButtonPressed(_ sender: Any)</code>.</p>
  
  <p>I couldn't find anything that could help me.</p>