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


class NEVPNConnection : NSObject


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.


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.


static let NEVPNStatusDidChange: NSNotification.Name

Posted when the status of the VPN connection changes.


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