@@ -23,7 +23,7 @@ import Foundation
2323import Network
2424#endif
2525
26- @objc
26+ @objcMembers
2727// swiftlint:disable:next type_body_length
2828public class Room: NSObject , @unchecked Sendable , ObservableObject , Loggable {
2929 // MARK: - MulticastDelegate
@@ -37,71 +37,52 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable {
3737 // MARK: - Public
3838
3939 /// Server assigned id of the Room.
40- @objc
4140 public var sid : Sid ? { _state. sid }
4241
4342 /// Server assigned id of the Room. *async* version of ``Room/sid``.
44- @objc
4543 public func sid( ) async throws -> Sid {
4644 try await _sidCompleter. wait ( )
4745 }
4846
49- @objc
5047 public var name : String ? { _state. name }
5148
5249 /// Room's metadata.
53- @objc
5450 public var metadata : String ? { _state. metadata }
5551
56- @objc
5752 public var serverVersion : String ? { _state. serverInfo? . version. nilIfEmpty }
5853
5954 /// Region code the client is currently connected to.
60- @objc
6155 public var serverRegion : String ? { _state. serverInfo? . region. nilIfEmpty }
6256
6357 /// Region code the client is currently connected to.
64- @objc
6558 public var serverNodeId : String ? { _state. serverInfo? . nodeID. nilIfEmpty }
6659
67- @objc
6860 public var remoteParticipants : [ Participant . Identity : RemoteParticipant ] { _state. remoteParticipants }
6961
70- @objc
7162 public var activeSpeakers : [ Participant ] { _state. activeSpeakers }
7263
73- @objc
7464 public var creationTime : Date ? { _state. creationTime }
7565
7666 /// If the current room has a participant with `recorder:true` in its JWT grant.
77- @objc
7867 public var isRecording : Bool { _state. isRecording }
7968
80- @objc
8169 public var maxParticipants : Int { _state. maxParticipants }
8270
83- @objc
8471 public var participantCount : Int { _state. numParticipants }
8572
86- @objc
8773 public var publishersCount : Int { _state. numPublishers }
8874
8975 /// User-provided URL.
90- @objc
9176 public var url : String ? { _state. providedUrl? . absoluteString }
9277
9378 /// Actual server URL used for the current connection (may include a regional URL).
94- @objc
9579 public var connectedUrl : String ? { _state. connectedUrl? . absoluteString }
9680
97- @objc
9881 public var token : String ? { _state. token }
9982
10083 /// Current ``ConnectionState`` of the ``Room``.
101- @objc
10284 public var connectionState : ConnectionState { _state. connectionState }
10385
104- @objc
10586 public var disconnectError : LiveKitError ? { _state. disconnectError }
10687
10788 public var connectStopwatch : Stopwatch { _state. connectStopwatch }
@@ -110,7 +91,6 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable {
11091
11192 public var e2eeManager : E2EEManager ?
11293
113- @objc
11494 public lazy var localParticipant : LocalParticipant = . init( room: self )
11595
11696 let primaryTransportConnectedCompleter = AsyncCompleter < Void > ( label: " Primary transport connect " , defaultTimeout: . defaultTransportState)
@@ -219,14 +199,12 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable {
219199
220200 // MARK: Objective-C Support
221201
222- @objc
223202 override public convenience init ( ) {
224203 self . init ( delegate: nil ,
225204 connectOptions: ConnectOptions ( ) ,
226205 roomOptions: RoomOptions ( ) )
227206 }
228207
229- @objc
230208 // swiftlint:disable:next cyclomatic_complexity function_body_length
231209 public init ( delegate: RoomDelegate ? = nil ,
232210 connectOptions: ConnectOptions ? = nil ,
@@ -326,7 +304,6 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable {
326304 }
327305 }
328306
329- @objc
330307 // swiftlint:disable:next cyclomatic_complexity function_body_length
331308 public func connect( url urlString: String ,
332309 token: String ,
@@ -467,7 +444,6 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable {
467444 log( " Connected to \( String ( describing: self ) ) " , . info)
468445 }
469446
470- @objc
471447 public func disconnect( ) async {
472448 let shouldDisconnect = _state. mutate {
473449 switch $0. connectionState {
0 commit comments