Alamofire + AlamofireObjectMapper无法正常工作

时间:2016-09-04 08:44:21

标签: swift alamofire objectmapper

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
 }

返回的新闻数组为空。有人能帮帮我吗?

0 个答案:

没有答案