title: iOS User Interface without Storyboards: Change UITextField font and guarantee minimum characters for a textField Object
body: <p>I didn't find an answer that solved my problems or that was explained in an easy way. So please don't give me any other stack overflow links because I realy read them and couldn't solve my problem. I also looked up in the documentation. Thanks for helping me out.</p>
  
  <p>Problem1:
  Im building an iOS app with <strong>SWIFT</strong> and don't use storyboards for the user interfaces. I created a LoginController with the UItextfield userName where a new user can enter his userName (see below : userNameTextField ). I changed the placeholder text to the String "Name". </p>
  
  <p>Question1: How can I change the placeholder font and  textsize. I want to have a <strong>bold</strong> placeholder text. </p>
  
  <pre><code>let userNameTextField: UITextField = {
      let tf = UITextField()
      tf.placeholder = "Name"
      tf.translatesAutoresizingMaskIntoConstraints = false
  
      return tf
  
  }()
  </code></pre>
  
  <p>Problem2:</p>
  
  <p>Usernames must be at least five characters long before the registration can work. How can I guarantee this in my code. A kind of notification would be cool like Sorry you need at least 5 characters.
  Can you please give me just a short example for one UiTextField Object ?</p>
  
  <p>Thanks</p>