Class

NEVPNConnection

An object to start and stop a Personal VPN connection and get its status.

Declaration

class NEVPNConnection : NSObject

Overview

NEVPNConnection objects are not instantiated directly. Instead, each NEVPNManager object has an associated NEVPNConnection object as a read-only property.

The NEVPNConnection class provides methods for starting and stopping the VPN programmatically. The other way that the VPN can be started and stopped is through VPN On Demand. See the onDemandRules property in NEVPNManager and NEOnDemandRule.

Instances of this class are thread safe.

Topics

Controlling the VPN Connection

Getting VPN Connection Status

var status: NEVPNStatus

The current status of the VPN connection

var connectedDate: Date?

The date and time when the connection status changed to NEVPNStatusConnected.

Notifications

static let NEVPNStatusDidChange: NSNotification.Name

Posted when the status of the VPN connection changes.

Relationships

Inherits From

Conforms To

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