title: How to get textFields from static cells in UITableViewController? Swift
body: <p>My View hierarchy looks like this:<br>
       ElevethViewController of type UIViewController<br>
          Container View<br>
          ManagedTableEleventhViewController of type UITableViewController embedded in Container View    </p>
  
  <p>ManagedTableEleventhViewController contains 4 static cells containing 1 textField each and one empty static cell. </p>
  
  <pre><code>   class ManagedTableEleventhViewController: UITableViewController,UITextFieldDelegate {
  
    var hasText:Bool! 
    @IBOutlet weak var fullName: UITextField!
    @IBOutlet weak var flatNumber: UITextField!
    @IBOutlet weak var streetAddress: UITextField!
    @IBOutlet weak var phoneNumber: UITextField!
  
     //checkValue takes ELViewController parameter so that segue can be 
       //performed when button is touched in EleventhViewController
  
  
     func checkValue(ELViewController:EleventhViewController) {
  
       //loop through the textfields and check if they have text
         for case let textField as UITextField in viewController.view.subviews {
  
        //print is not executed meaning loop is not performed
               print("some text")
           if textField.text == "" {
               self.hasText = false
                 textField.layer.borderColor = UIColor.red.cgColor
                   } else {
               print("true value in for loop")
                self.hasText = true
  
      performSegue(withIdentifier: "elevethToTwelveth", sender: ELViewController)
         }
    }//end of for loop
  }
  
  
  
  
  
  class EleventhViewController: UIViewController {
  
      var nextButtonOutlet:UIButton!
  
        override func viewDidLoad() {
              super.viewDidLoad()
  
  //create button programmatically
        var button = UIButton(type: UIButtonType.custom) as UIButton
           button = UIButton(frame: CGRect(x: 0, y: 637, width: 375, height: 50))
            button.titleLabel?.textColor = UIColor.white
            button.backgroundColor = UIColor(colorLiteralRed: 117/255, green: 232/255, blue: 0, alpha: 1)
            button.setTitle("Next", for: .normal)
               button.addTarget(self, action: #selector(EleventhViewController.nextButton), for: .touchUpInside)
           self.view.addSubview(button)
            self.nextButtonOutlet = button
     }
  
  
         func nextButton(sender: UIButton) {
  
        //create instance of tableView
           let managedTable = ManagedTableEleventhViewController()
             managedTable.checkValue(viewController: self)
  
    } //end of  EleventhViewController class
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/fexLK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fexLK.png" alt="Main.storyboard"></a></p>