Instance Method

loadFromPreferences(completionHandler:)

Load the filter configuration from the Network Extension preferences.

Declaration

func loadFromPreferences(completionHandler: @escaping (Error?) -> Void)

Parameters

completionHandler

A block that takes an NSError object. This block will be executed on the caller's main thread after the load operation is complete. If the configuration does not exist in the Network Extension preferences or is loaded successfully, the error parameter will be nil. If an error occurred while loading the configuration, the error parameter will be set to an NSError object containing details about the error. See NEFilterManagerError for a list of possible errors.

Discussion

You must call this method at least once before calling saveToPreferencesWithCompletionHandler: for the first time after your app launches.

See Also

Managing the Filter Configuration

class func shared() -> NEFilterManager

Access the single instance of NEFilterManager.

func saveToPreferences(completionHandler: (Error?) -> Void)

Save the filter configuration in the Network Extension preferences.

func removeFromPreferences(completionHandler: (Error?) -> Void)

Remove the filter configuration from the Network Extension preferences.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software