Instance Method

start(completionHandler:)

Asynchronously starts the haptic engine and executes the completion handler once the engine has started.

Declaration

func start(completionHandler: CHHapticEngine.CompletionHandler? = nil)

Parameters

completionHandler

The completion handler to execute after the engine starts.

Discussion

This method blocks all subsequent event processing on the current thread until the engine has started. It throws an error if the engine can't start.

See Also

Starting and Stopping the Haptic Engine

func start()

Synchronously starts the haptic engine.

func stop(completionHandler: CHHapticEngine.CompletionHandler?)

Asynchronously stops the haptic engine and executes the completion handler once the engine has stopped.

typealias CHHapticEngine.CompletionHandler

A typealias for the block that the engine calls after starting or stopping.