Initializes a peer.
- iOS 7.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 10.0+
The display name for the local peer. If you use the multipeer browser view controller, this name is shown.
The display name is intended for use in UI elements, and should be short and descriptive of the local peer. The maximum allowable length is 63 bytes in UTF-8 encoding. The
displayparameter may not be
nilor an empty string.
An initialized peer ID object.
Call this method only when creating the local peer, not when you create objects that represent other devices.
This method throws an exception if the
display value is too long, empty, or
Each call to this method produces a unique peer ID, even for the same display name. If you need a device to maintain a consistent peer ID over time, you may want to archive and reuse it later instead of creating a new one every time your app starts advertising or browsing.