Created
September 29, 2008 04:07
-
-
Save nickjs/13549 to your computer and use it in GitHub Desktop.
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
@implementation LEValueAnimation : CPAnimation | |
{ | |
CPView _view; | |
CPString _keyPath; | |
} | |
- (LEAnimation)initWithView:(CPView)aView keyPath:(NSString)keyPath | |
{ | |
self = [super initWithDuration:1.0 animationCurve:CPAnimationLinear]; | |
if(self) | |
{ | |
if([aView respondsToSelector:@selector(keyPath)]){ | |
_view = aView; | |
_keyPath = keyPath; | |
} else { | |
return null; | |
} | |
} | |
return self; | |
} | |
- (void)setCurrentProgress:(float)progress | |
{ | |
[super setCurrentProgress:progress]; | |
var temp = "set"+_keyPath; | |
[_view performSelector:temp withObject:progress]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment