I won't be able to return a value with Alamofire in Swift
问题 The current code I'm having doens't seem to return anything, I can't find out what is causing the issue. func getQuests(category: NSString, count: Int) -> NSArray { var quests = NSArray() Alamofire.request(.GET, apiUrlString, parameters: ["category": category, "count": count]) .responseJSON { (request, response, json, error) in dispatch_async(dispatch_get_main_queue(), { quests = json as NSArray }) } println(quests) #=> () return quests } Does anybody know how to solve the issue I'm having?