Instance Method

singleValueContainer()

Returns an encoding container appropriate for holding a single primitive value.

Required.

Declaration

func singleValueContainer() -> SingleValueEncodingContainer

Return Value

A new empty single value container.

Discussion

You must use only one kind of top-level encoding container. This method must not be called after a call to unkeyedContainer() or container(keyedBy:), or after encoding a value through a call to singleValueContainer()