Skip to content

Instantly share code, notes, and snippets.

@nickjs
Created September 29, 2008 04:07
Show Gist options
  • Save nickjs/13549 to your computer and use it in GitHub Desktop.
Save nickjs/13549 to your computer and use it in GitHub Desktop.
@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