Required Instance Methodswift 6.0.1Swift
container(keyedBy:)
Returns an encoding container appropriate for holding multiple values keyed by the given key type.
func container<Key>(keyedBy type: Key.Type) -> KeyedEncodingContainer<Key> where Key : CodingKey
Parameters
- type
The key type to use for the container.
Returns
A new keyed encoding container.
You must use only one kind of top-level encoding container. This method must not be called after a call to unkeyedContainer()
or after encoding a value through a call to singleValueContainer()
Other requirements
Instance members
var codingPath: [any CodingKey]
The path of coding keys taken to get to this point in encoding.
var userInfo: [CodingUserInfoKey : Any]
Any contextual information set by the user for encoding.
func singleValueContainer(
) -> any SingleValueEncodingContainer Returns an encoding container appropriate for holding a single primitive value.
func unkeyedContainer(
) -> any UnkeyedEncodingContainer Returns an encoding container appropriate for holding multiple unkeyed values.