---
title: "removeFromPreferences(completionHandler:)"
framework: Network Extension
role: symbol
role_heading: Instance Method
platforms: [iOS 17.0+, iPadOS 17.0+, Mac Catalyst 17.0+, macOS 14.0+, tvOS 17.0+, visionOS 1.0+]
path: "networkextension/nerelaymanager/removefrompreferences(completionhandler:)"
---

# removeFromPreferences(completionHandler:)

Remove your relay configuration from the system networking preferences.

## Declaration

```swift
func removeFromPreferences(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func removeFromPreferences() async throws
```

## Parameters

- `completionHandler`: An optional block that takes an doc://com.apple.documentation/documentation/Foundation/NSError object. If specified, this block runs on your application’s main thread after your configuration is removed. If an error occurs while removing the configuration, the block returns an NSError object.

## Discussion

Discussion After you remove your configuration, the NERelayManager object still contains the configuration parameters. Calling loadFromPreferences(completionHandler:) clears out the configuration parameters from the NERelayManager object.

## See Also

### Managing relay configurations

- [shared()](networkextension/nerelaymanager/shared().md)
- [loadFromPreferences(completionHandler:)](networkextension/nerelaymanager/loadfrompreferences(completionhandler:).md)
- [saveToPreferences(completionHandler:)](networkextension/nerelaymanager/savetopreferences(completionhandler:).md)
