send(_:to:)
Sends a custom type asynchronously to other participants in the group session.
Declaration
final func send<Message>(_ value: Message, to participants: Participants = .all) async throws where Message : Decodable, Message : EncodableParameters
- participants:
The recipients of the message. The default value of this parameter is the set of all active participants in the session. Use the Only(_:) Swift.enum.case option to specify a subset of participants.
Discussion
Use this method to send data that you package into a custom class or structure. The method encodes your custom structure’s type information, and delivers the data only to message sequences of the same type.