Minimum characters for a text field? (Swift)
<p>I´m currently working on a login and registration(Xcode 7, Swift2). If a user registers and types his desired username in the text field,i would like him to type at least 5 characters. So if he leaves the text field and haven´t typed in at least 5 characters, a message get´s displayed that tells him to type in at least 5 characters.
I only found how to determine the maximum amount of characters, but was not able to adjust it to my needs.
This is my current code:</p>

<pre><code>import UIKit

class ViewController: UIViewController,UITextFieldDelegate {

    // Mark: Properties

    @IBOutlet weak var Username: UITextField!
    @IBOutlet weak var Password: UITextField!
    @IBOutlet weak var Status: UILabel!
    @IBOutlet weak var DesiredUsername: UITextField!


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // Mark: Actions

    @IBAction func CreateAccount(sender: UIButton) {
    }
    @IBAction func LoginButtonTapped(sender: UIButton) {

        if (Username.text == "janoschvongehr" &amp;&amp; Password.text == "test123") {
          performSegueWithIdentifier("SeguetoPeople", sender: nil)
        }

        if (Username.text == "" || Password.text == "") {
        Status.text = "Nicht alle Felder ausgefüllt"
        }

        self.Username.resignFirstResponder()
        self.Password.resignFirstResponder()
    }
    override func touchesBegan(touches: Set&lt;UITouch&gt;, withEvent event: UIEvent?) {
        self.view.endEditing(true)
    }

    func textFieldShouldReturn(textField: UITextField) -&gt; Bool {
        self.view.endEditing(true)
        return true
    }


}
</code></pre>

<p>I just started with programming, so it would be great if you could keep the answers as simple as possible. 
Thank you, guys!</p>