Q:

Checking Username Availability while the user is typing iOS

Like the title explained well, I'm looking to check if user exist in parse.com while the user is typing.  I came out so far with this code from their documentation but if you have better suggestion
let userName = userNameTextField.text
let query = PFUser.query()
query!.whereKey("Username", equalTo:"%userName%")
let usernames = query!.findObjects()
if usernames ! = nil { print("existing")} else {print("notexisting")}

A:

Simple example for you:
// First get user's inputted text
let enteredUserName = userNameTextField.text

// Then query and compare
var query = PFQuery(className: "User")
query.whereKey("yourUsers", equalTo: enteredUserName)
query.findObjectsInBackgroundWithBlock {
    (objects: [AnyObject]?,  error: NSError?)  in
    if error == nil {
        if (objects!.count > 0){
            isTaken = true
            println("username is taken")
        } else {
            println("Username is available. ") 
        }
    } else {
        println("error")
    }
}

From THIS post.