Skip to content

Instantly share code, notes, and snippets.

View jayrhynas's full-sized avatar

Jayson Rhynas jayrhynas

View GitHub Profile
@jayrhynas
jayrhynas / CustomKeyCodable.swift
Last active February 25, 2021 16:23 — forked from IanKeen/CustomKeyCodable.swift
PropertyWrapper: CustomKeyCodable allows defining the keys for decoding _per property_
protocol CustomKeyCodable: Codable {
static var keyEncodingStrategy: ([CodingKey]) -> CodingKey { get }
static var keyDecodingStrategy: ([CodingKey]) -> CodingKey { get }
init()
}
extension CustomKeyCodable {
init(from decoder: Decoder) throws {
self.init()