---
title: NEFilterProvider
framework: networkextension
role: symbol
role_heading: Class
path: networkextension/nefilterprovider
---

# NEFilterProvider

An abstract base class shared by content filters.

## Declaration

```swift
class NEFilterProvider
```

## Overview

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 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 class. important: To use the NEFilterProvider class, you must enable the Network Extensions capability in Xcode and select the Content Filter capability. See Configure network extensions. 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:) stopFilter(with:completionHandler:)

## Topics

### Managing the filter life cycle

- [startFilter(completionHandler:)](networkextension/nefilterprovider/startfilter(completionhandler:).md)
- [stopFilter(with:completionHandler:)](networkextension/nefilterprovider/stopfilter(with:completionhandler:).md)

### Getting the filter configuration

- [filterConfiguration](networkextension/nefilterprovider/filterconfiguration.md)

### Receiving reports

- [handle(_:)](networkextension/nefilterprovider/handle(_:).md)

### Handling errors

- [NEFilterErrorDomain](networkextension/nefiltererrordomain.md)
- [NEFilterManagerError](networkextension/nefiltermanagererror.md)

## Relationships

### Inherits From

- [NEProvider](networkextension/neprovider.md)

### Inherited By

- [NEFilterControlProvider](networkextension/nefiltercontrolprovider.md)
- [NEFilterDataProvider](networkextension/nefilterdataprovider.md)
- [NEFilterPacketProvider](networkextension/nefilterpacketprovider.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Data and control providers

- [NEFilterDataProvider](networkextension/nefilterdataprovider.md)
- [NEFilterControlProvider](networkextension/nefiltercontrolprovider.md)
- [NEFilterPacketProvider](networkextension/nefilterpacketprovider.md)
