---
title: "init(_:)"
framework: network
role: symbol
role_heading: Initializer
path: "network/nwendpoint/port/init(_:)"
---

# init(_:)

Initializes a port with a string.

## Declaration

```swift
init?(_ service: String)
```

## Discussion

Discussion Port strings are expected to be numeric values between 0 and 65535. Initializing with any other string will fail.
