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

# init(_:)

Initializes an IP address with a string.

## Declaration

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

## Discussion

Discussion The provided string will be interpreted as an IPv4 or IPv6 address. If the string cannot be interpreted as an address, the initialization will fail.

## See Also

### Creating Addresses

- [init(_:_:)](network/ipaddress/init(_:_:).md)
