Returns the action object assigned to the specified key.
- iOS 2.0+
- macOS 10.5+
- tvOS 9.0+
- Core Animation
The identifier of the action.
Returns the object that provides the action for
key. The object must implement the
This method searches for the given action object of the layer. Actions define dynamic behaviors for a layer. For example, the animatable properties of a layer typically have corresponding action objects to initiate the actual animations. When that property changes, the layer looks for the action object associated with the property name and executes it. You can also associate custom action objects with your layer to implement app-specific actions.
This method searches for the layer’s associated actions in the following order:
If the layer has a delegate that implements the
action(for:method, the layer calls that method. The delegate must do one of the following:
Return the action object for the given key.
NSNullobject if it does not handle the action.
The layer looks in the layer’s
actionsdictionary for a matching key/action pair.
The layer calls the
defaultclass method to look for any class-defined actions.
If any of the above steps returns an instance of
NSNull, it is converted to
nil before continuing.
When an action object is invoked it receives three parameters: the name of the event, the object on which the event happened (the layer), and a dictionary of named arguments specific to each event kind.