ios - Getting Exception: "Impossible to set up layout with view hierarchy unprepared for constraint" -


In my storyboard application, I try to add additional UITextField in the interface. But I think the title says that the exception is found. I use the library here my code is:

  // Mark: - IBotlet @IBotlet weak verte passwordTestfield: UITFField! // Mark: - Property user idetextfield = UTFieldfield () / Mark: - Lifecycle Override FOX ViewDiaload () {super overviewDidload () itself Password typefiled.keyboardtip = .NETPad if getCurrentUserId () == zero {self.view.addSubview (UserIdTextField) userIdTextField.setTranslatesAutoresizingMaskIntoConstraints (false) self.view.addConstraints ([userIdTextField.al_leading == passwordTextField.al_leading, userIdTextField.al_trailing == Password TextField.al_trailing, userIdTextField.al_top == passwordTextField.al_bottom + 8]) userIdTextField.placeholder = "Enter User Id ..."}}  

passwordTextField > UPD (thanks @ Viemier and @markmark): Please note that more to add constraints to it Is protected ViewsDidoadload < / Code> or view aspires


Comments

Post a Comment