---
title: "removeTarget(_:)"
framework: mediaplayer
role: symbol
role_heading: Instance Method
path: "mediaplayer/mpremotecommand/removetarget(_:)"
---

# removeTarget(_:)

Removes a target from the remote command object.

## Declaration

```swift
func removeTarget(_ target: Any?)
```

## Parameters

- `target`: The object that currently is a recipient of action messages sent by this object. Specify nil to remove all targets.

## Discussion

Discussion Call the removeTarget(_:) method to remove the specified target and all actions associated with the target.

## See Also

### Handling events

- [addTarget(handler:)](mediaplayer/mpremotecommand/addtarget(handler:).md)
- [addTarget(_:action:)](mediaplayer/mpremotecommand/addtarget(_:action:).md)
- [removeTarget(_:action:)](mediaplayer/mpremotecommand/removetarget(_:action:).md)
- [MPRemoteCommandHandlerStatus](mediaplayer/mpremotecommandhandlerstatus.md)
