Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions lib/PRTween.m
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ + (PRTweenOperation *)tween:(id)object property:(NSString*)property from:(CGFloa
operation.boundSetter = [PRTween setterFromProperty:property];
[operation addObserver:[PRTween sharedInstance] forKeyPath:@"period.tweenedValue" options:NSKeyValueObservingOptionNew context:NULL];

[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0];
[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
return operation;

}
Expand All @@ -293,7 +293,7 @@ + (PRTweenOperation *)tween:(CGFloat *)ref from:(CGFloat)from to:(CGFloat)to dur
operation.boundRef = ref;
[operation addObserver:[PRTween sharedInstance] forKeyPath:@"period.tweenedValue" options:NSKeyValueObservingOptionNew context:NULL];

[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0];
[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
return operation;

}
Expand All @@ -319,7 +319,7 @@ + (PRTweenOperation *)lerp:(id)object property:(NSString *)property period:(PRTw
operation.boundSetter = [PRTween setterFromProperty:property];
[operation addObserver:[PRTween sharedInstance] forKeyPath:@"period.tweenedLerp" options:NSKeyValueObservingOptionNew context:NULL];

[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0];
[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
return operation;

}
Expand All @@ -338,7 +338,7 @@ + (PRTweenOperation *)tween:(id)object property:(NSString*)property from:(CGFloa
operation.boundSetter = [PRTween setterFromProperty:property];
[operation addObserver:[PRTween sharedInstance] forKeyPath:@"period.tweenedValue" options:NSKeyValueObservingOptionNew context:NULL];

[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0];
[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
return operation;

}
Expand All @@ -354,7 +354,7 @@ + (PRTweenOperation *)tween:(CGFloat *)ref from:(CGFloat)from to:(CGFloat)to dur
operation.boundRef = ref;
[operation addObserver:[PRTween sharedInstance] forKeyPath:@"period.tweenedValue" options:NSKeyValueObservingOptionNew context:NULL];

[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0];
[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
return operation;

}
Expand All @@ -372,7 +372,7 @@ + (PRTweenOperation *)lerp:(id)object property:(NSString *)property period:(PRTw
operation.boundSetter = [PRTween setterFromProperty:property];
[operation addObserver:[PRTween sharedInstance] forKeyPath:@"period.tweenedLerp" options:NSKeyValueObservingOptionNew context:NULL];

[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0];
[[PRTween sharedInstance] performSelector:@selector(addTweenOperation:) withObject:operation afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
return operation;

}
Expand Down Expand Up @@ -426,6 +426,7 @@ - (id)init {
timeOffset = 0;
if (timer == nil) {
timer = [NSTimer scheduledTimerWithTimeInterval:kPRTweenFramerate target:self selector:@selector(update) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
}
self.defaultTimingFunction = &PRTweenTimingFunctionQuadInOut;
}
Expand Down Expand Up @@ -671,7 +672,7 @@ - (void)update {

if (period != nil) {
if (target != nil && selector != NULL) {
[target performSelector:selector withObject:period afterDelay:0];
[target performSelector:selector withObject:period afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
}

// Check to see if blocks/GCD are supported
Expand All @@ -692,7 +693,7 @@ - (void)update {
// clean up expired tween operations
for (__strong PRTweenOperation *tweenOperation in expiredTweenOperations) {

if (tweenOperation.completeSelector) [tweenOperation.target performSelector:tweenOperation.completeSelector withObject:nil afterDelay:0];
if (tweenOperation.completeSelector) [tweenOperation.target performSelector:tweenOperation.completeSelector withObject:nil afterDelay:0 inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];
// Check to see if blocks/GCD are supported
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_4_0) {
if (tweenOperation.completeBlock != NULL) {
Expand Down