RawRepresentable

public extension RawRepresentable where RawValue: Decodable, Self: Decodable

Extends all RawRepresentables (enums) which are also Decodable with decode implementation.

I could not find a way to implicitly declare RawRepresentable conforming to Decodable, what would make all enums Decodable automatically. Because of that for an enum to be compatible with Decodable operators it must be declared as implementing Decodable protocol.

  • Undocumented

    Declaration

    Swift

    static func decode(_ json: Any) throws -> Self