You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 30, 2023. It is now read-only.
Return nil CAAction when swapping implementation (#109)
When swapping the implementation of `actionForKey:`, returning `NSNull`
would result in a crash because it could not respond to other messages
being passed (like `runAction:forKey:`). Instead, returning `nil` will
safely receive additional messages. This was easily reproducible by
running the unit test suite on iOS 8.1 or 8.3 simulators.
Returning `nil` matches the documented behavior of `actionForKey:` in
the CALayer headers:
> Returns the action object associated with the event named by the
> string 'event'. The default implementation searches for an action
> object in the following places:
>
> 1. if defined, call the delegate method -actionForLayer:forKey:
> 2. look in the layer's `actions' dictionary
> 3. look in any `actions' dictionaries in the `style' hierarchy
> 4. call +defaultActionForKey: on the layer's class
>
> If any of these steps results in a non-nil action object, the
> following steps are ignored. If the final result is an instance of
> NSNull, it is converted to `nil'.
>
> - (nullable id<CAAction>)actionForKey:(NSString *)event;
Also fixed a crash with CASpringAnimation on iOS 8.x because the desired
selectors aren't available.
0 commit comments