---
title: "perform(_:onTarget:)"
framework: spritekit
role: symbol
role_heading: Type Method
path: "spritekit/skaction/perform(_:ontarget:)"
---

# perform(_:onTarget:)

Creates an action that calls a method on an object.

## Declaration

```swift
class func perform(_ selector: Selector, onTarget target: Any) -> SKAction
```

## Parameters

- `selector`: The selector of the method to call.
- `target`: The target object.

## Return Value

Return Value A new action object.

## Discussion

Discussion The action object maintains a strong reference to the target object. When the action executes, the target object’s method is called. This action occurs instantaneously. This action is not reversible; the reverse of this action calls the selector again.

## See Also

### Creating Custom Actions

- [init(named:)](spritekit/skaction/init(named:).md)
- [init(named:duration:)](spritekit/skaction/init(named:duration:).md)
- [init(named:fromURL:)](spritekit/skaction/init(named:fromurl:).md)
- [init(named:fromURL:duration:)](spritekit/skaction/init(named:fromurl:duration:).md)
- [customAction(withDuration:actionBlock:)](spritekit/skaction/customaction(withduration:actionblock:).md)
- [run(_:)](spritekit/skaction/run(_:).md)
- [run(_:queue:)](spritekit/skaction/run(_:queue:).md)
