Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 406 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 406 Bytes

PeerStream

A simple wrapper around Multipeer Connectivity using async iterator streams.

let peerStream: PeerStream = PeerStream()
Task {
    for try await message in peerStream {
        switch message {
        case .onStateChange(state: let state, peer: let peer):
            print("STREAM", state == .connected, peer.displayName)
        default:
            break
        }
    }
}