func mapNewsJSONToNewsObjects() -> [News] {
let URL = "https://someURL"
let news:[News] = []
_ = Alamofire.request(URL, withMethod:.get).responseArray{ (response: Response<[News]>) in
if let newsArray:[News] = response.result.value {
debugPrint(newsArray)
}
}
return news
}
返回的新闻数组为空。有人能帮帮我吗?