I am trying to return the values that i get from the JSON response
func getAsset(imageId: String) -> String{
let url = "https://myimage.com"
Alamofire.request(.GET, url).responseJSON { response in
switch response.result {
case .Success:
if let value = response.result.value {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)) {
let json = JSON(value)
let singleAsset = json["fields"]["file"]["url"].string
print(singleAsset)
}
}
case .Failure(let error):
print(error)
}
}
}
I am trying to return the value (singleAsset) but cant because i keep getting the error unresolved identifier. Ive been trying all night but cant return to value.