Skip to content

Instantly share code, notes, and snippets.

@IanKeen
Created March 1, 2019 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IanKeen/9bff98b5f76eb61e631d6cdf21eec184 to your computer and use it in GitHub Desktop.
Save IanKeen/9bff98b5f76eb61e631d6cdf21eec184 to your computer and use it in GitHub Desktop.
CodablePrimitives; Allows for easier handling of types for custom en/de-coders in certain situations
protocol CodablePrimitive { }
extension String: CodablePrimitive { }
extension Bool: CodablePrimitive { }
extension Double: CodablePrimitive { }
extension Float: CodablePrimitive { }
extension Int: CodablePrimitive { }
extension Int8: CodablePrimitive { }
extension Int16: CodablePrimitive { }
extension Int32: CodablePrimitive { }
extension Int64: CodablePrimitive { }
extension UInt: CodablePrimitive { }
extension UInt8: CodablePrimitive { }
extension UInt16: CodablePrimitive { }
extension UInt32: CodablePrimitive { }
extension UInt64: CodablePrimitive { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment