I am using pods with Swift 4
pod 'SWXMLHash', '~> 4.0.0'
pod 'Alamofire', '~> 4.5'
When I am parsing XML with below code, getting the error:
Type 'XMLIndexer' does not conform to protocol 'Sequence'
Code:
Alamofire.request("https://itunes.apple.com/us/rss/topgrossingapplications/limit=10/xml").response { response in
debugPrint(response)
guard let data = response.data else {
return
}
let xml = SWXMLHash.parse(data)
let nodes = xml["feed"]["entry"]
for node in nodes {
print(node["title"].text)
}
}
I am trying to access 'entry' tag list from above iTunes XML URL. If there is any method to access and initialize the list of entries in class/struct, please help.