Skip to content

Commit

Permalink
add deprecation annotation on localPeerId
Browse files Browse the repository at this point in the history
  • Loading branch information
omichde committed May 28, 2022
1 parent fe5fb4c commit e1c275c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/MultipeerKit/Public API/MultipeerTransceiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public final class MultipeerTransceiver {
public var localPeer: Peer? {
return connection.getLocalPeer()
}


@available(*, deprecated, message: "If you need the String Id, you can get it from localPeer.id instead.")
public var localPeerId: String? {
return localPeer?.id
}

/// All peers currently available for invitation, connection and data transmission.
public private(set) var availablePeers: [Peer] = [] {
didSet {
Expand Down
1 change: 1 addition & 0 deletions Tests/MultipeerKitTests/MultipeerKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ final class MultipeerKitTests: XCTestCase {
mock.receive(TestPayload.self) { payload, sender in
XCTAssertEqual(payload, tsPayload)
XCTAssertEqual(sender.id, mock.localPeer!.id)
XCTAssertEqual(sender.id, mock.localPeerId!)

expect.fulfill()
}
Expand Down

0 comments on commit e1c275c

Please sign in to comment.