---
title: "init(for:from:disableUnicast:)"
framework: network
role: symbol
role_heading: Initializer
path: "network/nwmulticastgroup/init(for:from:disableunicast:)"
---

# init(for:from:disableUnicast:)

Initializes a multicast group with a set of multicast addresses.

## Declaration

```swift
init(for groupAddresses: [NWEndpoint], from: NWEndpoint? = nil, disableUnicast: Bool = false) throws
```

## Parameters

- `groupAddresses`: A set of multicast address endpoints you specify to define the IP multicast groups to join. The port indicates which local port the connection group will use to receive messages.
- `from`: An optional address endpoint used to filter received multicast packets.
- `disableUnicast`: A Boolean that specifies whether the connection group rejects unicast traffic.
