我正在尝试将RSS提要加载到IOS应用程序。通过相当多的教程找到了下面的,但它抛出了一个例外。
资料来源:
https://github.com/tichise/TIFeedParser
func loadRSS() {
let feedUrlString:String = "https://news.google.com/news?hl=us&ned=us&ie=UTF-8&oe=UTF-8&output=rss"
Alamofire.request(feedUrlString).response { response in
if let data = response.data, let _ = String(data: data, encoding: .utf8) {
TIFeedParser.parseRSS(xmlData: data as NSData, completionHandler: {(isSuccess, channel, error) -> Void in
if (isSuccess) {
self.items = channel!.items!
self.videoTableView.reloadData()
}
if (response.error != nil) {
print((response.error?.localizedDescription)! as String)
}
})
}
}
}
我做错什么了?如果是这样的话,参考还是怎么解决?会非常有帮助的!