Instance Method


Stop the network tunnel from the Packet Tunnel Provider.


func cancelTunnelWithError(_ error: Error?)



An NSError object containing the error that caused the tunnel to be stopped. The domain and code of this NSError object is defined by the caller.


The Packet Tunnel Provider should call this method when an unrecoverable error occurs, such as the tunnel server going down or the VPN authentication session expiring.

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