You can check if the username is stored like this:
let username = "fred"
self.ref.child("users/\(username)").observeSingleEventOfType(.Value, withBlock: { snapshot in
if snapshot.exists() {
If the snapshot returned in the closure exists, then the username "fred" exists.