encode(_:forKey:)
Encodes a given object and associates it with a given key.
Declaration
func encode(_ object: Any?, forKey key: String)Parameters
- object:
The value to encode. This value may be
nil. - key:
The key with which to associate
objv. This value must not benil.