<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWMulticastGroup/init(for:from:disableUnicast:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network16NWMulticastGroupC3for4from14disableUnicastACSayAA10NWEndpointOG_AHSgSbtKcfc"
  },
  "title" : "init(for:from:disableUnicast:)"
}
-->

# init(for:from:disableUnicast:)

Initializes a multicast group with a set of multicast addresses.

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)