I want to read the url
attribute from this element by using NSXMLParser:
<enclosure url="http://www.marketoloji.com/wp-content/uploads/2015/01/IMG_1649-110x110.jpg" length="7113" type="image/jpg"/>
I found this resource on Apple site but it's for obj C, not for Swift:
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/XMLParsing/Articles/HandlingElements.html#//apple_ref/doc/uid/20002265-BCIJFGJI
I know that I should work with attributeDict
dictionary in didStartElement
method but dont know how.
I learned it and here is the way it works in Swift:
in didStartElement
method;
if element.isEqualToString("enclosure") {
var imgLink = attributeDict["url"] as String
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With