Contents

encodeIfPresent(_:forKey:)

Encodes the given value for the given key if it is not nil.

Declaration

mutating func encodeIfPresent(_ value: String?, forKey key: KeyedEncodingContainer<K>.Key) throws

Parameters

  • value:

    The value to encode.

  • key:

    The key to associate the value with.

Discussion