DeviceAddressResolver
public final class DeviceAddressResolver : NSObject
extension DeviceAddressResolver: NetServiceDelegate
Resolves a device found via Bonjour.
After using NanoleafDeviceBrowser
to find local Nanoleaf devices,
use this class to resolve a device’s hostname and port.
-
Initialize a new
DeviceAddressResolver
instance.Declaration
Swift
public init( domain: String, type: String, name: String )
Parameters
domain
The device’s domain.
type
The device’s type.
name
The device’s name.
-
Initialize a new
DeviceAddressResolver
instance.Declaration
Swift
public convenience init(identifier: DeviceIdentifier)
Parameters
device
The device identifier to resolve.
-
resolve()
AsynchronousResolve the device’s address.
Throws
An error of typeDeviceAddressResolverError
.Declaration
Swift
public func resolve() async throws -> DeviceAddress
Return Value
A
DeviceAddress
instance.
-
Declaration
Swift
public func netServiceDidResolveAddress(_ sender: NetService)
-
Declaration
Swift
public func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber])