typedPayload(_:)
Decodes the user activity’s user info dictionary as an instance of the specified type.
Declaration
func typedPayload<T>(_ type: T.Type) throws -> T where T : Decodable, T : EncodableParameters
Return Value
The type-safe instance.
Discussion
Use this method to retrieve information from the user activity’s userInfo dictionary in a type-safe manner.
If the type can’t be decoded from the userInfo dictionary, this method throws NSUserActivity.TypedPayloadError.invalidContent.