Instance Method

loadFromPreferences(completionHandler:)

Loads the current DNS proxy configuration from the caller's DNS proxy preferences.

Declaration

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

Parameters

completionHandler

A block called when the load operation completes. If the operation fails, an error instance passed to this block describes the problem. Otherwise, the error is nil. See NEDNSProxyManagerError for the list of possible errors.

Discussion

Initially, the DNS proxy configuration comes from a configuration profile stored on the device in a managed environment, as described in Configuration Profile Reference.

When you want to inspect or make changes to the configuration, you call the proxy manager's loadFromPreferences(completionHandler:) method. This causes the system to load the configuration into the manager's providerProtocol and isEnabled properties.

If you modify the configuration stored in these properties, you must then call the saveToPreferences(completionHandler:) method to make the changes take effect. Saving the preferences also stores the modified configuration on disk for use the next time the proxy is started or the configuration is loaded.

See Also

Managing the DNS Proxy Configuration

class func shared() -> NEDNSProxyManager

Returns a singleton DNS proxy manager instance.

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

Saves the DNS proxy configuration in the caller's DNS proxy preferences.

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

Removes the DNS proxy configuration from the caller's DNS proxy 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