---
title: "actions(forTarget:forControlEvent:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uicontrol/actions(fortarget:forcontrolevent:)"
---

# actions(forTarget:forControlEvent:)

Returns the actions performed on a target object when the specified event occurs.

## Declaration

```swift
func actions(forTarget target: Any?, forControlEvent controlEvent: UIControl.Event) -> [String]?
```

## Parameters

- `target`: The target object—that is, an object that has an action method associated with this control. You must pass an explicit object for this method to return a meaningful result. Specifying nil always returns nil.
- `controlEvent`: A single control event constant representing the event for which you want the list of action methods. For a list of possible constants, see doc://com.apple.uikit/documentation/UIKit/UIControl/Event

## Return Value

Return Value An array NSString objects containing the selector names of the corresponding action methods, or nil if there are no action methods associated with the specified target object and control event.

## Discussion

Discussion Use this method to determine what action methods are called on the specified object in response to a particular control event. You can use the NSSelectorFromString(_:) function to convert the returned strings to valid selectors, as needed.

## See Also

### Related Documentation

- [sendAction(_:to:for:)](uikit/uicontrol/sendaction(_:to:for:).md)
- [sendActions(for:)](uikit/uicontrol/sendactions(for:).md)

### Managing the control’s targets and actions

- [addTarget(_:action:for:)](uikit/uicontrol/addtarget(_:action:for:).md)
- [removeTarget(_:action:for:)](uikit/uicontrol/removetarget(_:action:for:).md)
- [allTargets](uikit/uicontrol/alltargets.md)
- [addAction(_:for:)](uikit/uicontrol/addaction(_:for:).md)
- [removeAction(_:for:)](uikit/uicontrol/removeaction(_:for:).md)
- [removeAction(identifiedBy:for:)](uikit/uicontrol/removeaction(identifiedby:for:).md)
- [allControlEvents](uikit/uicontrol/allcontrolevents.md)
- [enumerateEventHandlers(_:)](uikit/uicontrol/enumerateeventhandlers(_:).md)
- [UIControl.Event](uikit/uicontrol/event.md)
