setTypedPayload(_:)
Encodes the specified payload into the user activity’s user info dictionary.
Declaration
func setTypedPayload<T>(_ payload: T) throws where T : Decodable, T : EncodableParameters
Discussion
Use this method to set the user activity’s userInfo dictionary in a type-safe manner. After you set the userInfo dictionary using this approach, the keys in the userInfo dictionary match the coding keys from the Codable type you provide as the payload.
If the type can’t be encoded into the userInfo dictionary, this method throws NSUserActivity.TypedPayloadError.encodingError.