<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEFilterDataProvider/apply(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEFilterDataProvider(im)applySettings:completionHandler:"
  },
  "title" : "apply(_:completionHandler:)"
}
-->

# apply(_:completionHandler:)

Applies a set of filtering rules associated with the provider and changes the default filtering action.

```
func apply(_ settings: NEFilterSettings?, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`settings`

A [`NEFilterSettings`](/documentation/NetworkExtension/NEFilterSettings) object containing the filter settings to apply to the system. Pass `nil` to revert to the default settings, which are an empty list of rules and a default action of [`NEFilterAction.filterData`](/documentation/NetworkExtension/NEFilterAction/filterData).

`completionHandler`

A Swift closure or ObjectiveC block that executes when the system finishes applying the settings. It receives an <doc://com.apple.documentation/documentation/Foundation/NSError> parameter; a non-`nil` value that indicates there’s an error contidition.

---

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)