Permalink
Browse files

Merge pull request #9 from typeoneerror/master

Delays and Method naming fixes.
  • Loading branch information...
2 parents 9dfd84d + 378c806 commit b43526686e5baa21a8ac13e04cfd210e8092dcd2 @domhofmann committed Dec 21, 2011
Showing with 17 additions and 3 deletions.
  1. +2 −0 lib/PRTween.h
  2. +12 −0 lib/PRTween.m
  3. +3 −3 lib/PRTweenTimingFunctions.m
View
@@ -108,6 +108,7 @@ typedef void (^PRTweenCompleteBlock)();
@interface PRTweenCGPointLerp : NSObject
+ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGPoint)from to:(CGPoint)to duration:(CGFloat)duration timingFunction:(PRTweenTimingFunction)timingFunction target:(NSObject *)target completeSelector:(SEL)selector;
++ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGPoint)from to:(CGPoint)to duration:(CGFloat)duration delay:(CGFloat)delay timingFunction:(PRTweenTimingFunction)timingFunction target:(NSObject *)target completeSelector:(SEL)selector;
+ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGPoint)from to:(CGPoint)to duration:(CGFloat)duration;
#if NS_BLOCKS_AVAILABLE
+ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGPoint)from to:(CGPoint)to duration:(CGFloat)duration timingFunction:(PRTweenTimingFunction)timingFunction updateBlock:(PRTweenUpdateBlock)updateBlock completeBlock:(PRTweenCompleteBlock)completeBlock;
@@ -116,6 +117,7 @@ typedef void (^PRTweenCompleteBlock)();
@interface PRTweenCGRectLerp : NSObject
+ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGRect)from to:(CGRect)to duration:(CGFloat)duration timingFunction:(PRTweenTimingFunction)timingFunction target:(NSObject *)target completeSelector:(SEL)selector;
++ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGRect)from to:(CGRect)to duration:(CGFloat)duration delay:(CGFloat)delay timingFunction:(PRTweenTimingFunction)timingFunction target:(NSObject *)target completeSelector:(SEL)selector;
+ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGRect)from to:(CGRect)to duration:(CGFloat)duration;
#if NS_BLOCKS_AVAILABLE
+ (PRTweenOperation *)lerp:(id)object property:(NSString*)property from:(CGRect)from to:(CGRect)to duration:(CGFloat)duration timingFunction:(PRTweenTimingFunction)timingFunction updateBlock:(PRTweenUpdateBlock)updateBlock completeBlock:(PRTweenCompleteBlock)completeBlock;
View
@@ -144,6 +144,12 @@ + (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGPoin
return [PRTween lerp:object property:property period:[PRTweenCGPointLerpPeriod periodWithStartCGPoint:from endCGPoint:to duration:duration] timingFunction:timingFunction target:target completeSelector:selector];
}
++ (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGPoint)from to:(CGPoint)to duration:(CGFloat)duration delay:(CGFloat)delay timingFunction:(PRTweenTimingFunction)timingFunction target:(NSObject *)target completeSelector:(SEL)selector {
+ PRTweenCGPointLerpPeriod *period = [PRTweenCGPointLerpPeriod periodWithStartCGPoint:from endCGPoint:to duration:duration];
+ period.delay = delay;
+ return [PRTween lerp:object property:property period:period timingFunction:timingFunction target:target completeSelector:selector];
+}
+
+ (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGPoint)from to:(CGPoint)to duration:(CGFloat)duration {
return [PRTweenCGPointLerp lerp:object property:property from:from to:to duration:duration timingFunction:NULL target:nil completeSelector:NULL];
}
@@ -162,6 +168,12 @@ + (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGRect
return [PRTween lerp:object property:property period:[PRTweenCGRectLerpPeriod periodWithStartCGRect:from endCGRect:to duration:duration] timingFunction:timingFunction target:target completeSelector:selector];
}
++ (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGRect)from to:(CGRect)to duration:(CGFloat)duration delay:(CGFloat)delay timingFunction:(PRTweenTimingFunction)timingFunction target:(NSObject *)target completeSelector:(SEL)selector {
+ PRTweenCGRectLerpPeriod *period = [PRTweenCGRectLerpPeriod periodWithStartCGRect:from endCGRect:to duration:duration];
+ period.delay = delay;
+ return [PRTween lerp:object property:property period:period timingFunction:timingFunction target:target completeSelector:selector];
+}
+
+ (PRTweenOperation *)lerp:(id)object property:(NSString *)property from:(CGRect)from to:(CGRect)to duration:(CGFloat)duration {
return [PRTweenCGRectLerp lerp:object property:property from:from to:to duration:duration timingFunction:NULL target:nil completeSelector:NULL];
}
@@ -122,7 +122,7 @@ CGFloat PRTweenTimingFunctionExpoOut (CGFloat t, CGFloat b, CGFloat c, CGFloat d
return (t==d) ? b+c : c * (-pow(2, -10 * t/d) + 1) + b;
}
-CGFloat PRTweenTimingFunctioExpoIn (CGFloat t, CGFloat b, CGFloat c, CGFloat d) {
+CGFloat PRTweenTimingFunctionExpoIn (CGFloat t, CGFloat b, CGFloat c, CGFloat d) {
return (t==0) ? b : c * pow(2, 10 * (t/d - 1)) + b;
}
@@ -137,7 +137,7 @@ CGFloat PRTweenTimingFunctionQuadOut (CGFloat t, CGFloat b, CGFloat c, CGFloat d
return -c *(t/=d)*(t-2) + b;
}
-CGFloat PRTweenTimingFunctioQuadIn (CGFloat t, CGFloat b, CGFloat c, CGFloat d) {
+CGFloat PRTweenTimingFunctionQuadIn (CGFloat t, CGFloat b, CGFloat c, CGFloat d) {
return c*(t/=d)*t + b;
}
@@ -150,7 +150,7 @@ CGFloat PRTweenTimingFunctionQuartOut (CGFloat t, CGFloat b, CGFloat c, CGFloat
return -c * ((t=t/d-1)*t*t*t - 1) + b;
}
-CGFloat PRTweenTimingFunctioQuartIn (CGFloat t, CGFloat b, CGFloat c, CGFloat d) {
+CGFloat PRTweenTimingFunctionQuartIn (CGFloat t, CGFloat b, CGFloat c, CGFloat d) {
return c*(t/=d)*t*t*t + b;
}

0 comments on commit b435266

Please sign in to comment.