TypeDecoder

public struct TypeDecoder

TypeDecoder allows you to decode a Swift type by using TypeDecoder.decode() and passing the type to be decoded.

  • Returns a TypeInfo enum which describes the type passed in.

    Usage Example:

    struct StructureType: Decodable {
      let aString: String
    }
    
    let structureTypeInfo = try TypeDecoder.decode(StructureType.self)
    

    Declaration

    Swift

    public static func decode(_ type: Decodable.Type) throws -> TypeInfo