Instance Method

startStream(withName:toPeer:)

Opens a byte stream to a nearby peer.

Declaration

func startStream(withName streamName: String, toPeer peerID: MCPeerID) throws -> OutputStream

Parameters

streamName

A name for the stream. This name is provided to the nearby peer.

peerID

The ID of the nearby peer.

Return Value

An output stream instance.

Discussion

This method is nonblocking.

For more information about performing networking with input and output streams, read Networking Programming Topics.

See Also