This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Robert Moore
authored and
ianegordon
committed
Jan 25, 2018
1 parent
fd9710d
commit 53255ab
Showing
3 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters