init(destinationNetwork:prefix:protocol:)
Creates a rule that matches network traffic destined for a host within a specific network.
Declaration
init(destinationNetwork networkEndpoint: NWHostEndpoint, prefix destinationPrefix: Int, protocol: NENetworkRule.Protocol)Parameters
- networkEndpoint:
An endpoint instance that matches the port and address or network that the rule matches. This endpoint must contain an address, not a hostname.
- destinationPrefix:
An integer that in combination with the address in the endpoint specifies the destination network that the rule matches.
- protocol:
The protocol that the rule matches.
Discussion
If the port string of networkEndpoint is 0 or the empty string, the rule matches traffic on any port destined for the given address or network.