title: Test UITextField text string to only contain alphanumeric characters
body: <p>Im trying to complete form validation in Swift and cant find a way of testing for only Alphanumeric characters in a UITextField.text. </p>
  
  <p>Ive found NSCharacterSet to help test if at least 1 letter has been entered (so far):</p>
  
  <pre><code>@IBOutlet weak var username: UITextField!
  let letters = NSCharacterSet.letterCharacterSet()
  
  //Check username contains a letter
     if (username.text!.rangeOfCharacterFromSet(letters) == nil) {
          getAlert("Error", message: "Username must contain at least 1 letter")
      }
  </code></pre>
  
  <p>Now i just need a way to validate that only numbers, letters (maybe even underscores and dashes) to be entered. Loads of stuff out there for Obj-C but I need a SWIFT solution please.</p>
  
  <p>Thank you in advance.</p>