<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEFilterProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEFilterProvider"
  },
  "title" : "NEFilterProvider"
}
-->

# NEFilterProvider

An abstract base class shared by content filters.

```
class NEFilterProvider
```

## Overview

A Network Content Filter is made up of two Filter Provider extensions:

The **Filter Data Provider extension** examines network content as it passes through the network stack on the device and decides if the network content should be blocked or allowed to pass on to its final destination.

Because the Filter Data Provider extension has access to all of the network content flowing through the device, it runs in a very restrictive sandbox. The sandbox prevents the Filter Data Provider extension from moving network content outside of its address space by blocking all network access, IPC, and disk write operations.

The Filter Data Provider extension is implemented by creating a custom subclass of the [`NEFilterDataProvider`](/documentation/NetworkExtension/NEFilterDataProvider) class.

The **Filter Control Provider extension** is responsible for feeding information to the Filter Data Provider extension so that the Filter Data Provider extension can do its job.

For example, the Filter Control Provider extension can be notified by the Filter Data Provider extension that it does not have enough information to make a decision about a particular flow of network content. The Filter Control Provider extension can then download more filtering rules from a server and write the rules to a location where the Filter Data Provider can access them.

The Filter Control Provider extension is implemented by creating a custom subclass of the [`NEFilterControlProvider`](/documentation/NetworkExtension/NEFilterControlProvider) class.

> Important:
> To use the ``doc://com.apple.networkextension/documentation/NetworkExtension/NEFilterProvider`` class, you must enable the Network Extensions capability in Xcode and select the Content Filter capability. See [Configure network extensions](http://help.apple.com/xcode/mac/current/#/dev0b2ef6f08).

### Subclassing Notes

`NEFilterProvider` should not be subclassed directly. Instead, you should create subclasses of `NEFilterProvider’s` subclasses and override the following methods:

#### Methods to Override

- [`startFilter(completionHandler:)`](/documentation/NetworkExtension/NEFilterProvider/startFilter(completionHandler:))
- [`stopFilter(with:completionHandler:)`](/documentation/NetworkExtension/NEFilterProvider/stopFilter(with:completionHandler:))

## Topics

### Managing the filter life cycle

[`-  startFilterWithCompletionHandler:`](/documentation/NetworkExtension/NEFilterProvider/startFilter(completionHandler:))

Start the filter.

[`-  stopFilterWithReason:completionHandler:`](/documentation/NetworkExtension/NEFilterProvider/stopFilter(with:completionHandler:))

Stop the filter.

### Getting the filter configuration

[`filterConfiguration`](/documentation/NetworkExtension/NEFilterProvider/filterConfiguration)

An [`NEFilterProviderConfiguration`](/documentation/NetworkExtension/NEFilterProviderConfiguration) object containing the current filter configuration.

### Receiving reports

[`-  handleReport:`](/documentation/NetworkExtension/NEFilterProvider/handle(_:))

Receives a report from the framework.

### Handling errors

[`NEFilterErrorDomain`](/documentation/NetworkExtension/NEFilterErrorDomain)

The domain for errors resulting from calls to the filter manager.

[`NEFilterManagerError`](/documentation/NetworkExtension/NEFilterManagerError)

Error codes specific to filter managers.

## Relationships

### Inherited By

[`NEFilterControlProvider`](/documentation/NetworkExtension/NEFilterControlProvider)

[`NEFilterDataProvider`](/documentation/NetworkExtension/NEFilterDataProvider)

[`NEFilterPacketProvider`](/documentation/NetworkExtension/NEFilterPacketProvider)

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NEProvider`](/documentation/NetworkExtension/NEProvider)

---

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)