---
title: "loadFromPreferences(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/loadfrompreferences(completionhandler:)"
---

# loadFromPreferences(completionHandler:)

Load your relay configuration from the system networking preferences.

## Declaration

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

```swift
func loadFromPreferences() async throws
```

## Parameters

- `completionHandler`: A block that takes an doc://com.apple.documentation/documentation/Foundation/NSError object. This block runs on your application’s main thread after the load operation is complete. If an error occurs while loading the configuration, the block returns an NSError object.

## Discussion

Discussion You must call this method at least once before calling saveToPreferences(completionHandler:) for the first time after your app launches.

## See Also

### Managing relay configurations

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