addTarget(handler:)
Adds a block to be called when an event is received.
Declaration
func addTarget(handler: @escaping (MPRemoteCommandEvent) -> MPRemoteCommandHandlerStatus) -> AnyParameters
- handler:
A block object to handle the Mpremotecommandevent.
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.