A description used to advertise the Bonjour service that a listener provides.


struct NWListener.Service


Defining Services

init(name: String?, type: String, domain: String?, txtRecord: NWTXTRecord)

Initializes a Bonjour service to advertise with a TXT record.

var noAutoRename: Bool

A Boolean that indicates whether the service prohibits automatic renaming in the event of a name conflict.


Inspecting Services

let name: String?

The Bonjour name of the service.

let type: String

The Bonjour type of the service.

let domain: String?

The Bonjour domain of the service.

var txtRecordObject: NWTXTRecord?

The TXT record to advertise with the service.

let txtRecord: Data?

The TXT record as a raw buffer to advertise with the service.

var debugDescription: String

The description of the service.

Operator Functions


See Also

Advertising Bonjour Services

var service: NWListener.Service?

A Bonjour service that advertises the listener on the local network.

var serviceRegistrationUpdateHandler: ((NWListener.ServiceRegistrationChange) -> Void)?

A handler that receives updates for the service endpoint being advertised.

enum NWListener.ServiceRegistrationChange

Changes to how a network listener's service is advertised.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software