<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEFilterRule/init(networkRule:action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEFilterRule(im)initWithNetworkRule:action:"
  },
  "title" : "init(networkRule:action:)"
}
-->

# init(networkRule:action:)

Creates a new filter rule from a network rule and an action to take when network traffic matches.

```
init(networkRule: NENetworkRule, action: NEFilterAction)
```

## Parameters

`networkRule`

An [`NENetworkRule`](/documentation/NetworkExtension/NENetworkRule) object that defines the network traffic characteristics that this rule matches.

`action`

The action to take when the network rule matches.

---

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)