이번 포스트에서는 Swift에서 제공하는 Codable을 사용하여 JSON을 Encode하고 Decode하도록 하겠습니다. Codable은 Swift 4.x부터 지원하는 Protocol입니다. 공식 문서에 따르면 Codable은 A type that can convert itself into and out of an external representation." 자기 자신을 외부 표현으로 변환(Encode)하거나 외부 표현으로부터 변환(Decode)할 수 있는 타입이라고 합니다. 즉, Codable은 Encodable과 Decodable을 합친 것인데, 각각 정의를 살펴보면 아래와 같습니다. typealias Codable = Decodable & Encodable Codable은 Protocol 이기 ..