Open
Description
say I have this xml:
<channel>
<title>The Changelog: Software Development, Open Source</title>
<itunes:summary>Software's best weekly news brief, deep technical interviews & talk show.</itunes:summary>
<itunes:author>Changelog Media</itunes:author>
</channel>
which is a stripped down example from the real world of parsing Podcast RSS Feeds :)
It'd be great if I could decode that into something like:
struct Channel: Codable {
let title:String
struct iTunes: Codable {
let summary: String
let author: String
}
}
I know I can store all three values in a single flat Channel
structure given what's in the Readme, but is there any advanced way to cause this deeper structuring, putting the elements prefixed with iTunes:
into the nested iTunes
struct?
Right now my flattened version looks like this:
struct Channel: Codable {
let title: String
let itunesSummary: String?
let itunesAuthor: String?
enum CodingKeys: String, CodingKey {
case title
case itunesSummary = "itunes:summary"
case itunesAuthor = "itunes:author"
}
}
Metadata
Metadata
Assignees
Labels
No labels