One Logo Pool Ball
Network · IOS API REFERENCE

IPv6Address

struct · iOS 12.0+ · SDK 27.1

struct IPv6Address

IPv6Address Base type to hold an IPv6 address and convert between strings and raw bytes. Note that an IPv6 address may be scoped to an interface.

Members (21)

get · iOS 12.0+

isLoopback

TypeScript
getIsLoopback($self: IPv6Address): boolean
Swift declaration
var isLoopback: Bool { get }

Is the looback address "::1"

get · iOS 12.0+

isLinkLocal

TypeScript
getIsLinkLocal($self: IPv6Address): boolean
Swift declaration
var isLinkLocal: Bool { get }

Is a link-local address

get · iOS 12.0+

isMulticast

TypeScript
getIsMulticast($self: IPv6Address): boolean
Swift declaration
var isMulticast: Bool { get }

Is multicast

get · iOS 12.0+

isIPv4Mapped

TypeScript
getIsIPv4Mapped($self: IPv6Address): boolean
Swift declaration
var isIPv4Mapped: Bool { get }

Is an IPv4 mapped address such as "::ffff:1.2.3.4"

get · iOS 12.0+

isUniqueLocal

TypeScript
getIsUniqueLocal($self: IPv6Address): boolean
Swift declaration
@backDeployed(before: macOS 14, iOS 17, watchOS 10, tvOS 17)
var isUniqueLocal: Bool { get }

Is unique local address

get · iOS 12.0+

linkLocalNodes

TypeScript
get linkLocalNodes(): IPv6Address
Swift declaration
static let linkLocalNodes: IPv6Address

IPv6 all link local nodes multicast

get · iOS 12.0+

multicastScope

TypeScript
getMulticastScope($self: IPv6Address): (IPv6Address_Scope) | null
Swift declaration
var multicastScope: IPv6Address.Scope? { get }

Returns the multicast scope

get · iOS 12.0+

nodeLocalNodes

TypeScript
get nodeLocalNodes(): IPv6Address
Swift declaration
static let nodeLocalNodes: IPv6Address

IPv6 all node local nodes multicast

get · iOS 12.0+

debugDescription

TypeScript
getDebugDescription($self: IPv6Address): 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+

linkLocalRouters

TypeScript
get linkLocalRouters(): IPv6Address
Swift declaration
static let linkLocalRouters: IPv6Address

IPv6 all link local routers multicast

get · iOS 12.0+

isIPv4Compatabile

TypeScript
getIsIPv4Compatabile($self: IPv6Address): boolean
Swift declaration
var isIPv4Compatabile: Bool { get }

Is an IPv4 compatible address

get · iOS 12.0+

any

TypeScript
get any(): IPv6Address
Swift declaration
static let any: IPv6Address

IPv6 any address

get · iOS 12.0+

isAny

TypeScript
getIsAny($self: IPv6Address): boolean
Swift declaration
var isAny: Bool { get }

Is the Any address "::0"

get · iOS 12.0+

asIPv4

TypeScript
getAsIPv4($self: IPv6Address): (IPv4Address) | null
Swift declaration
var asIPv4: IPv4Address? { get }

For IPv6 addresses that are IPv4 mapped, returns the IPv4 address - Returns: nil unless the IPv6 address was mapped or compatible, in which case the IPv4 address is returned.

get · iOS 12.0+

is6to4

TypeScript
getIs6to4($self: IPv6Address): boolean
Swift declaration
var is6to4: Bool { get }

Is a 6to4 IPv6 address

get · iOS 12.0+

loopback

TypeScript
get loopback(): IPv6Address
Swift declaration
static let loopback: IPv6Address

IPv6 loopback address

get · iOS 12.0+

rawValue

TypeScript
getRawValue($self: IPv6Address): ArrayBuffer
Swift declaration
var rawValue: Data { get }

Fetch the raw address (sixteen bytes)

get · iOS 12.0+

broadcast

TypeScript
get broadcast(): IPv6Address
Swift declaration
static let broadcast: IPv6Address

IPv6 broadcast address

get · iOS 12.0+

interface

TypeScript
getInterface($self: IPv6Address): (NWInterface) | null
Swift declaration
let interface: NWInterface?

The interface the address is scoped to, if any.

init · iOS 12.0+

init

TypeScript
init(rawValue: ArrayBuffer, interface_?: (NWInterface) | null): (IPv6Address) | null
Swift declaration
init?(_ rawValue: Data, _ interface: NWInterface? = nil)

Create an IPv6 from a raw 16 byte value and optional interface - Parameter rawValue: A 16 byte IPv6 address - Parameter interface: An optional interface the address is scoped to. Defaults to nil. - Returns: nil unless the raw data contained an IPv6 address

init · iOS 12.0+

init

TypeScript
init40195(string: string): (IPv6Address) | null
Swift declaration
init?(_ string: String)

Create an IPv6 address from a string literal such as "fe80::1%lo0" or "2001:DB8::5" This function does not perform hostname resolution. This is similar to calling getaddrinfo with AI_NUMERICHOST. - Parameter string: An IPv6 address literal string. - Returns: nil unless the string contained an IPv6 literal

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

IPv6Address

The iOS SDK compiler rejected this binding: type 'IPv6Address' does not conform to protocol 'RawRepresentable'

All Network types →