Swift and Parse findObjectsInBackgroundWithBlock not returning my Array
<p>when the compiler reach the end of findObjectsInBackgroundWithBlock my coordinatesArray loses the values and the function returns a empty array. Can you help Please?
Thank you in advance</p>

<pre><code> func getSquadMembersCoordinates() -&gt; Array&lt;PFGeoPoint&gt; {
    var coordinatesArray:[PFGeoPoint] = [PFGeoPoint]()

    if user != nil {

            let userSquad = PFUser.currentUser()?["inSquad"] as? String

            let query = PFUser.query()
            query?.whereKey("username", notEqualTo: (PFUser.currentUser()?    ["username"])!)
            query?.whereKey("inSquad", equalTo: userSquad!)
            query?.whereKey("visible", notEqualTo: false)
            query?.findObjectsInBackgroundWithBlock {
                (results: [PFObject]?, error: NSError?) -&gt; Void in
                if error == nil {
                    if results?.count != 0 {

                        if let results = results {
                            for object in results {
                                coordinatesArray.append(object.objectForKey("location") as! PFGeoPoint)

                            }
                        }
                    } else {
                        print("No Squad Members or not visible")
                    }
                } else {
                    print ("\(error)")
                }
            }
        } else {

            dispatch_async(dispatch_get_main_queue(), { () -&gt; Void in
                let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("SquadVC")
                self.presentViewController(viewController, animated: true, completion: nil)
            })
    }



    print("\(coordinatesArray.count)")
    return coordinatesArray

}
</code></pre>