Instance Method

stopTunnel(with:completionHandler:)

Stop the network tunnel.

Declaration

func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void)

Parameters

reason

An NEProviderStopReason code indicating why the tunnel is being stopped. Possible codes are listed in NEProvider.

completionHandler

A block that must be executed when the tunnel is fully stopped.

Discussion

This method is called by the system to stop the network tunnel.

NEPacketTunnelProvider subclasses must override this method.

Do not use this method to stop the tunnel from the Packet Tunnel Provider. Use cancelTunnelWithError: instead.

See Also

Managing the Tunnel Life Cycle

func cancelTunnelWithError(Error?)

Stop the network tunnel from the Packet Tunnel Provider.