Skip to content

Instantly share code, notes, and snippets.

@emma-k-alexandra
Created July 18, 2020 01:07
Show Gist options
  • Save emma-k-alexandra/b3e517c9f4a1dd22ef198a66c1b1b26f to your computer and use it in GitHub Desktop.
Save emma-k-alexandra/b3e517c9f4a1dd22ef198a66c1b1b26f to your computer and use it in GitHub Desktop.
struct Content: Codable {
let content: [Element]
enum Element: Codable {
case header(Header)
case paragraph(Paragraph)
case footer(Footer)
struct Header: Codable {
let title: String
let level: Int
}
struct Paragraph: Codable {
let text: String
}
struct Footer: Codable {
let style: String
let copyright: String
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment