ChannelEvent

public class ChannelEvent : CommunicationEvent<ChannelEventData>

ChannelEvent provides a generic implementation for broadcasting objects through a channel.

Static Factory Methods.

  • Create a ChannelEvent instance for delivering the given object.

    The channel identifier must be a non-empty string that does not contain the following characters: NULL (U+0000), # (U+0023), + (U+002B), / (U+002F).

    Throws

    if channel identifier is invalid

    Declaration

    Swift

    public static func with(object: CoatyObject,
    
                            channelId: String,
    
                            privateData: [String: Any]? = nil) throws -> ChannelEvent

    Parameters

    object

    the object to be channelized.

    channelId

    channel identifier string

    privateData

    application-specific options (optional)

    Return Value

    a Channel event with the given parameters

  • Create a ChannelEvent instance for delivering the given objects.

    The channel identifier must be a non-empty string that does not contain the following characters: NULL (U+0000), # (U+0023), + (U+002B), / (U+002F).

    Throws

    if channel identifier is invalid

    Declaration

    Swift

    public static func with(objects: [CoatyObject],
    
                            channelId: String,
    
                            privateData: [String: Any]? = nil) throws -> ChannelEvent

    Parameters

    objects

    the objects to be channelized

    channelId

    channel identifier string

    privateData

    application-specific options (optional)

    Return Value

    a Channel event with the given parameters

Codable methods.

  • Undocumented

    Declaration

    Swift

    public required init(from decoder: Decoder) throws
  • Undocumented

    Declaration

    Swift

    override public func encode(to encoder: Encoder) throws