Contents

addTarget(handler:)

Adds a block to be called when an event is received.

Declaration

func addTarget(handler: @escaping (MPRemoteCommandEvent) -> MPRemoteCommandHandlerStatus) -> Any

Parameters

Return Value

An opaque object associated with the designated handler.

Discussion

Call the addTarget(handler:) method to add a block to be called. Remove the handler by calling the removeTarget(_:) method, passing in the object returned by this method.

See Also

Handling events