forked from livekit/client-sdk-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicit delegate signatures (livekit#283)
A few delegates had the same signatures (by using overloading) such as: `room(_ room: Room, didUpdate speakers: [Participant])` `room(_ room: Room, didUpdate metadata: String?)` `room(_ room: Room, didUpdate isRecording: Bool)` This pattern will break if add another method of the same type will be added in the future: `room(_ room: Room, didUpdate isSomeExampleFlag: Bool)` Additionally, since labels can be omitted in Swift, the implementation side can be ambiguous: ```Swift func room(_: Room, didUpdate _: String?) { // ... } func room(_: Room, didUpdate _: Bool) { // ... } ``` This PR makes delegate signatures explicit and future-proof by including the label in the signature: `room(_ room: Room, didUpdateSpeakingParticipants participants: [Participant])` `room(_ room: Room, didUpdateMetadata metadata: String?)` `room(_ room: Room, didUpdateIsRecording isRecording: Bool)` I can deprecate the old methods, but since this will be part of v2 release maybe it's not required to deprecate.
- Loading branch information
1 parent
e901d1e
commit 81a5ff4
Showing
10 changed files
with
143 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.