Contents

start(completionHandler:)

Starts the VM and notifies the specified completion handler if startup is successful.

Declaration

func start(completionHandler: @escaping (Result<Void, any Error>) -> Void)

Parameters

  • completionHandler:

    The block to call with the results of the startup attempt. This block has no return value and has one Nserror object as its parameter:

    result

    A result type that contains an error object when the VM fails to start.

Discussion

Call this method to start a VM that’s in the VZVirtualMachine.State.stopped or VZVirtualMachine.State.error state. To determine if a VM is in a state that allows you to start it, check the VM’s canStart property.

See Also

Starting and stopping the VM