animation(forKey:)
Returns the animation object with the specified identifier.
Declaration
func animation(forKey key: String) -> CAAnimation?Parameters
- key:
A string that specifies the identifier of the animation. This string corresponds to the identifier string you passed to the Add(_:forkey:) method.
Return Value
The animation object matching the identifier, or nil if no such animation exists.
Discussion
Use this method to retrieve only animation objects already associated with a layer. Modifying any properties of the returned object results in undefined behavior.