LiveKit Swift Client SDK Documentation

Class Multicast​Delegate

public class MulticastDelegate<T>: NSObject, Loggable  

A class that allows to have multiple delegates instead of one.

Uses NSHashTable internally to maintain a set of weak delegates.

Note: NSHashTable may not immediately deinit the un-referenced object, due to Apple's implementation, therefore .count is unreliable.

%179 MulticastDelegate MulticastDelegate Loggable Loggable MulticastDelegate->Loggable NSObject NSObject MulticastDelegate->NSObject

Conforms To

Loggable

Allows to extend with custom log method which automatically captures current type (class name).

NSObject

Methods

add(delegate:​)

public func add(delegate: T)  

Add a single delegate.

remove(delegate:​)

public func remove(delegate: T)  

Remove a single delegate.

In most cases this is not required to be called explicitly since all delegates are weak.

remove​All​Delegates()

public func removeAllDelegates()  

Remove all delegates.