Created
November 2, 2016 09:57
-
-
Save cacaodev/10e803cf0ddf361688d393f7191faf26 to your computer and use it in GitHub Desktop.
Ask the animator if he wants frame updates for a given key path
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
- (id)initWithTarget:(id)aTarget | |
{ | |
self = [super initWithTarget:aTarget]; | |
_wantsPeriodicFrameUpdates = NO; | |
return self; | |
} | |
- (void)requestPeriodicFrameUpdates | |
{ | |
_wantsPeriodicFrameUpdates = YES; | |
} | |
- (void)_needsPeriodicFrameUpdatesForKeyPath:(CPString)aKeyPath | |
{ | |
return ((aKeyPath == @"frame" || aKeyPath == @"frameSize") && ([_target hasCustomLayoutSubviews] || [_target hasCustomDrawRect])) || _wantsPeriodicFrameUpdates; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment