Aug 28, 2017 · 1 min read
Привет, можно, через enum:
enum CodingKeys: String, CodingKey {
case createdAt = “created_at”
}
То есть, мы создаем контейнер, а потом энкодим через него:
var container = encoder.container(encodedBy: CodingKeys.self)
try container.encode(createdAt, forKey: .createdAt)
