Skip to content

Instantly share code, notes, and snippets.

@jonbrooks
jonbrooks / recursion.swift
Last active September 17, 2018 21:33
InfiniteRecursion
struct Foo {
let json: [Any]
}
extension Foo: Decodable {
enum Keys: String, CodingKey {
case json
}
init(from decoder: Decoder) throws {
let cont = try decoder.container(keyedBy: Keys.self)
json = try cont.decode(Array<Any>.self, forKey: .json)