Skip to content

Instantly share code, notes, and snippets.

@JBergsee
JBergsee / Codable+Array and Dictionary.swift
Last active May 20, 2023 22:19
Extensions to encode/decode Arrays and Dictionaries that are members in structs/classes
// All credits to initial authors!
// https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24 and
// https://gist.github.com/oteronavarretericardo/7da7bdeadf3829b1cadf5a2a10e83d85
//
// With some help from Quinn the Eskimo to solve problem with 0/1 and Booleans...
// https://forums.swift.org/t/jsonserialization-turns-bool-value-to-nsnumber/31909/2
import Foundation