One Logo Pool Ball
Network · IOS API REFERENCE

NWEndpoint

enum · iOS 12.0+ · SDK 27.1

enum NWEndpoint

Members (4)

get · iOS 12.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

init · iOS 26.4+

init

TypeScript
static init(endpoint: NWEndpoint, newPort: NWEndpoint_Port): (NWEndpoint) | null
Swift declaration
init?(copying endpoint: NWEndpoint, newPort: NWEndpoint.Port)

Creates a new `NWEndpoint` by copying an existing endpoint and specifying a new port. - Parameters: - endpoint: The source endpoint to copy. - newPort: The new port to use. - Returns: A new `NWEndpoint` instance copied from the source endpoint with a new port, or `nil` if the original endpoint is invalid or if modifying the port for the copy results in an invalid endpoint. Examples of invalid endpoints are malformed IP addresses or port numbers greater than 65535.

get · iOS 12.0+

interface

TypeScript
get interface(): (NWInterface) | null
Swift declaration
var interface: NWInterface? { get }

Returns the interface the endpoint is scoped to, if any

get · iOS 16.0+

txtRecord

TypeScript
get txtRecord(): (NWTXTRecord) | null
Swift declaration
var txtRecord: NWTXTRecord? { get }

Returns the TXT record present on the endpoint, if any

Skipped declarations

No declarations were skipped in this snapshot.

All Network types →