Parsing XML in Swift

Episode #425 | 30 minutes | published on January 23, 2020 | Uses Xcode-11.2.1, Swift-5.1
Subscribers Only
Sometimes legacy APIs that we have to deal with only support XML, and while Swift has first class support for JSON with Codable, XML parsing is still done with Foundation's XMLParser. This is a powerful yet difficult to use class that is modeled as a streaming XML parser. This means you have to write some code that keeps track of the values and state of where we are in the XML document in order to parse it. In this episode we will cover how to parse an XML document using multiple objects, parsers, and a delegate stack.

Episode Links

blog comments powered by Disqus