Hi guys I've been searching the net without much luck but I'm trying to get around Alamofires asynchronous nature. I'm trying to return the JSON response as a dictionary but Xcode is giving me "Dictionary is not convertible to 'Void'"
func homePageDetails(userName:String) -> (Dictionary<String,AnyObject>){
let username = userName
let hompePageDetails = Alamofire.request(.GET, "http://example.com/API/Bunch/GetHomePageDetails/\(username)/").responseJSON{(request, response, JSON, error) in
print(JSON)
var test = JSON as Dictionary<String,AnyObject>
return test
}
}
Any help would be greatly appreciated.