ARTChannels
Objective-C
@interface ARTChannels<ChannelType> : NSObject
Swift
class ARTChannels<ChannelType> : NSObject, @unchecked Sendable where ChannelType : AnyObject
Creates and destroys ARTRestChannel
and ARTRealtimeChannel
objects.
-
Checks if a channel has been previously retrieved using the
-[ARTChannels get:]
method.Declaration
Objective-C
- (BOOL)exists:(NSString *)name;
Swift
func exists(_ name: String!) -> Bool
Parameters
name
The channel name.
Return Value
true
if the channel exists, otherwisefalse
. -
Creates a new
ARTRestChannel
orARTRealtimeChannel
object, or returns the existing channel object.Declaration
Objective-C
- (ChannelType)get:(NSString *)name;
Swift
func get(_ name: String!) -> ChannelType!
Parameters
name
The channel name.
Return Value
A
ARTRestChannel
orARTRealtimeChannel
object. -
Creates a new
ARTRestChannel
orARTRealtimeChannel
object, with the specifiedARTChannelOptions
, or returns the existing channel object.Declaration
Objective-C
- (ChannelType)get:(NSString *)name options:(ARTChannelOptions *)options;
Swift
func get(_ name: String!, options: ARTChannelOptions!) -> ChannelType!
Parameters
name
The channel name.
options
An
ARTChannelOptions
object.Return Value
A
ARTRestChannel
orARTRealtimeChannel
object. -
Releases an
ARTRestChannel
or anARTRealtimeChannel
object by deleting it. It also removes any listeners associated with the channel. To release anARTRealtimeChannel
channel, theARTRealtimeChannelProtocol.state
must beARTRealtimeChannelState.ARTRealtimeChannelInitialized
,ARTRealtimeChannelState.ARTRealtimeChannelDetached
, orARTRealtimeChannelState.ARTRealtimeChannelFailed
.Declaration
Objective-C
- (void)release:(NSString *)name;
Swift
func release(_ name: String!)
Parameters
name
The channel name.