One Logo Pool Ball
Network · IOS API REFERENCE

NWEndpoint.Port

struct · iOS 12.0+ · SDK 27.1

struct Port

A network port (TCP or UDP)

Members (14)

init · iOS 12.0+

init

TypeScript
initIntegerLiteral(value: number): NWEndpoint_Port
Swift declaration
init(integerLiteral value: NWEndpoint.Port.IntegerLiteralType)

Creates an instance initialized to the specified integer value. Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal. For example: let x = 23 In this example, the assignment to the `x` constant calls this integer literal initializer behind the scenes. - Parameter value: The value to create.

get · iOS 12.0+

debugDescription

TypeScript
getDebugDescription($self: NWEndpoint_Port): 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.

get · iOS 12.0+

any

TypeScript
get any(): NWEndpoint_Port
Swift declaration
static let any: NWEndpoint.Port
get · iOS 12.0+

pop

TypeScript
get pop(): NWEndpoint_Port
Swift declaration
static let pop: NWEndpoint.Port
get · iOS 12.0+

ssh

TypeScript
get ssh(): NWEndpoint_Port
Swift declaration
static let ssh: NWEndpoint.Port
get · iOS 12.0+

http

TypeScript
get http(): NWEndpoint_Port
Swift declaration
static let http: NWEndpoint.Port
get · iOS 12.0+

imap

TypeScript
get imap(): NWEndpoint_Port
Swift declaration
static let imap: NWEndpoint.Port
get · iOS 12.0+

smtp

TypeScript
get smtp(): NWEndpoint_Port
Swift declaration
static let smtp: NWEndpoint.Port
get · iOS 12.0+

https

TypeScript
get https(): NWEndpoint_Port
Swift declaration
static let https: NWEndpoint.Port
get · iOS 12.0+

imaps

TypeScript
get imaps(): NWEndpoint_Port
Swift declaration
static let imaps: NWEndpoint.Port
get · iOS 12.0+

socks

TypeScript
get socks(): NWEndpoint_Port
Swift declaration
static let socks: NWEndpoint.Port
init · iOS 12.0+

init

TypeScript
initRawValue(rawValue: number): (NWEndpoint_Port) | null
Swift declaration
init?(rawValue: UInt16)

Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance.

get · iOS 12.0+

rawValue

TypeScript
getRawValue($self: NWEndpoint_Port): number
Swift declaration
var rawValue: UInt16 { get }

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

init · iOS 12.0+

init

TypeScript
init(service: string): (NWEndpoint_Port) | null
Swift declaration
init?(_ service: String)

Create a port from a string. Supports common service names such as "http" as well as number strings such as "80". - Parameter service: A service string such as "http" or a number string such as "80" - Returns: A port if the string can be converted to a port, nil otherwise.

Skipped declarations

No declarations were skipped in this snapshot.

All Network types →