Contents

perform(_:onTarget:)

Creates an action that calls a method on an object.

Declaration

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

Parameters

  • selector:

    The selector of the method to call.

  • target:

    The target object.

Return Value

A new action object.

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