removeFromPreferences(completionHandler:)
Remove your relay configuration from the system networking preferences.
Declaration
func removeFromPreferences(completionHandler: @escaping @Sendable ((any Error)?) -> Void)func removeFromPreferences() async throwsParameters
- completionHandler:
An optional block that takes an 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
NSErrorobject.
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.