Required Instance Methodswift 6.0.1Swift

    decodeIfPresent(_:)

    Decodes a value of the given type, if present.

    mutating func decodeIfPresent(_ type: Int8.Type) throws -> Int8?

    Parameters

    type

    The type of value to decode.

    Returns

    A decoded value of the requested type, or nil if the value is a null value, or if there are no more elements to decode.

    Throws

    DecodingError.typeMismatch if the encountered encoded value is not convertible to the requested type.

    This method returns nil if the container has no elements left to decode, or if the value is null. The difference between these states can be distinguished by checking isAtEnd.

    Other requirements

    View members

    Hide members

    This section is hidden by default because it contains too many (41) members.

    Instance members

    Citizens in Swift

    Default implementations