Handling an attribute of an XML element in Swift

后端 未结 1 1506
后悔当初
后悔当初 2021-01-13 10:18

I want to read the url attribute from this element by using NSXMLParser:



        
相关标签:
1条回答
  • 2021-01-13 10:26

    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
        }
    
    0 讨论(0)
提交回复
热议问题