An object you use to browse for available network services.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Network
Declaration
final class NWBrowser
An object you use to browse for available network services.
SDKs
Framework
final class NWBrowser
init(for: NWBrowser .Descriptor, using: NWParameters)
Initializes a browser with a type of service to discover.
enum NWBrowser .Descriptor
A service description used to discover Bonjour services.
func start(queue: Dispatch Queue)
Starts browsing for services, and sets the queue on which all browser events will be delivered.
var browse Results Changed Handler: ((Set<NWBrowser .Result>, Set<NWBrowser .Result .Change>) -> Void)?
A handler that delivers updates about discovered services.
struct NWBrowser .Result
A set of discovered services and changes from the last result.
var browse Results: Set<NWBrowser .Result>
The list of discovered services.
var state Update Handler: ((NWBrowser .State) -> Void)?
A handler that receives browser state updates.
enum NWBrowser .State
States indicating whether a browser is able to discover services.
var state: NWBrowser .State
The current state of the browser.
func cancel()
Stops browsing for services.
let descriptor: NWBrowser .Descriptor
The service descriptor with which the browser was initialized.
let parameters: NWParameters
The parameters with which the browser was initialized.
var queue: Dispatch Queue?
The queue on which browser events are delivered.
var debug Description: String
The description of the browser.
class NWConnection
A bidirectional data connection between a local endpoint and a remote endpoint.
class NWListener
An object you use to listen for incoming network connections.
class NWEthernet Channel
An object you use to send and receive custom Ethernet frames.