title: Can't return a value from UITextField to UILabel in UITableViewCell as subviews
body: <p>I made a <code>UITextfield</code> to receive the data from user.</p>
  
  <p>I want to convert a value from <code>UITextField</code> to <code>UILabel</code>.</p>
  
  <p>I did it in simple <code>UIView</code>, which has only two object, <code>UITextField</code> and <code>UILabel</code>.</p>
  
  <p>This is the code that works.</p>
  
  <pre><code>class ViewController: UIViewController, UITextFieldDelegate {
  
      let inputNumber = UITextField(frame: CGRect(x: 150.0, y: 100.0, width: 200.0, height: 50.0))
      let outputNumber = UILabel(frame: CGRect(x: 150.0, y: 200.0, width: 200.0, height: 50.0))
      let toolBarKeyBoard = UIToolbar()
      let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
      let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: nil, action: #selector(donePressed))
      var result : String!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          calculatePrice()
      }
  
      func calculatePrice () {
  
          priceInputLabel.keyboardType = .numberPad
          priceInputLabel.clearButtonMode = .whileEditing
  
          self.view.addSubview(priceInputLabel)
          toolBarKeyBoard.sizeToFit()
          toolBarKeyBoard.setItems([flexibleSpace, doneButton], animated: false)
          priceInputLabel.inputAccessoryView = toolBarKeyBoard
      }
  
      @objc func donePressed() {
          view.endEditing(true)
          result = inputNumber.text!
          let convertedNumber = (result as NSString).doubleValue
          if Int(inputNumber.text!) == nil {
              outputNumber.text = String("Nil")
          } else {
              outputNumber.text = String(Int(convertedNumber * 0.85))
          }
      }
  }
  </code></pre>
  
  <p>But in other case, down below, the problem is <code>UITextField</code> and <code>UILabel</code> are in the <code>UITableViewCell</code> as subviews.</p>
  
  <p>I made a 3 swift files. 2 files are <code>UITableViewCell</code> subclasses, and 1 file is a <code>UITableView</code> class.</p>
  
  <p><strong>1. FruitTableViewCell : UITableViewCell subclass</strong></p>
  
  <pre><code>class FruitTableViewCell: UITableViewCell, UITextFieldDelegate {
  
      var fruitsTextField = UITextField()
      let toolBarKeyBoard = UIToolbar()
      let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
      let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: nil, action: #selector(donePressed))
      var result : String!
  
  
      override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
          super.init(style: style, reuseIdentifier: reuseIdentifier)
  
          self.contentView.addSubview(fruitsTextField)
  
      }
  
      override func layoutSubviews() {
          super.layoutSubviews()
          fruitsTextField.frame = CGRect(x: 250, y: 7.5, width: 100, height: 30)
          fruitsTextField.textColor = UIColor(red: CGFloat(242/255.0), green: CGFloat(56/255.0), blue: CGFloat(90/255.0), alpha: 1.0)
          fruitsTextField.keyboardType = .numberPad
          fruitsTextField.clearButtonMode = .whileEditing
  
      toolBarKeyBoard.sizeToFit()
  
      fruitsTextField.inputAccessoryView = toolBarKeyBoard
  
      toolBarKeyBoard.setItems([flexibleSpace, doneButton], animated: false)
  
  
      }
  
  
      @objc func donePressed() {
          fruitTextField.endEditing(true)
      }
  }
  </code></pre>
  
  <p><strong>2. AnotherFruitTableViewCell : UITableViewCell subclass</strong></p>
  
  <pre><code>class AnotherFruitTableViewCell: UITableViewCell {
  
      var fruitsTextLabel = UILabel()
  
      override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
          super.init(style: style, reuseIdentifier: reuseIdentifier)
  
          self.contentView.addSubview(fruitsTextLabel)
  
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
  
      override func layoutSubviews() {
          super.layoutSubviews()
  
          fruitsTextLabel.backgroundColor = UIColor.brown
          fruitsTextLabel.frame = CGRect(x: 250.0, y: 7.5, width: 100.0, height: 30.0)
      }
  }
  </code></pre>
  
  <p><strong>3. TableViewController : UITableViewController class</strong></p>
  
  <pre><code>class TableViewController: UITableViewController, UITextFieldDelegate {
  
      let fruitsComponents: [String] = ["Apple", "Banana", "Grape", "Pear"]
  
      let cellReuseidentifier = "cell"
      let anotherCellReuseidentifier = "anotherCell"
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          tableView.register(FruitTableViewCell.self, forCellReuseIdentifier: cellReuseidentifier)
          tableView.register(AnotherFruitTableViewCell.self, forCellReuseIdentifier: anotherCellReuseidentifier)  
      }
  
      override func numberOfSections(in tableView: UITableView) -&gt; Int {      
          return 1
      }
  
          override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {        
          return fruitsComponents.count
      }
  
      override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          if indexPath.row == 0 {
              let cell = tableView.dequeueReusableCell(withIdentifier: cellReuseidentifier, for: indexPath) as! FruitTableViewCell
              cell.textLabel?.text = fruitsComponents[indexPath.row]
              return cell
          } else {
              let cell = tableView.dequeueReusableCell(withIdentifier: anotherCellReuseidentifier, for: indexPath) as! AnotherFruitTableViewCell
              cell.textLabel?.text = fruitsComponents[indexPath.row]
              return cell
          }
      }
  }
  </code></pre>
  
  <p>The <strong>fruitsTextField</strong> and <strong>fruitsTextLabel</strong> is not in the same class like in the first example code. </p>
  
  <p>So, I cannot call both instances and calculate a value in <code>ViewController</code> class. Of course, cannot return a calculated value.</p>
  
  <p>And, I'm not sure I can return after touching a done button to get a value from <code>UITextField</code> to <code>UILabel</code>, because the cells which is the super view of subview(<code>UITextField</code> and <code>UILabel</code>) are reproduced. I'm confusing touching a done button occurs dequeueing cells again.</p>
  
  <p><strong>How can I return a value from UITextField to UILabel in UITableViewCell?</strong></p>
  
  <p>Thanks!</p>