⌘K

Type

A provider for handling type converters for various data types. Its maps specific types to their respective converters, allowing easy conversion between objects and their string representations.


INativeType

Defines the contract for converting a type to and from its string representation.

open class INativeType<T>
  • Type Parameter T: The type being converted.

Initializers

init()

Initializes a new instance of the type converter.

public init()

Methods

toString(_:)

Converts a value of type T to a string representation.

open func toString(_ input: T?) -> String
Parameters
  • input: The value to convert.
Returns

A string representation of the value.

fromString(_:)

Converts a string representation back to a value of type T.

open func fromString(_ input: String?) -> T
Parameters
  • input: The string to convert.
Returns

A value of type T.