Creates an action that executes a block over a duration.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
The duration of the action, in seconds.
The block to run. The block takes the following parameters:
The node on which the action is running.
The amount of time that has passed in the animation.
A new action object.
When the action executes, the block is called repeatedly until the action’s duration expires. The elapsed time is computed and passed to the block whenever the block is called.
This action is not reversible; the reverse action executes the same block.
The following code shows how you can create a custom action to update an attribute of an
SKShader attached to a sprite node.