Open edolecki opened 11 years ago
Simple: add an -invalidate
method to the PRTweenOperation
object, and in the large animation processing loop fired by the timer, check if the invalidation flag is set.
You can do [[PRTween sharedInstance] removeTweenOperation:tweenOperation];
- the only problem is that it won't remove the tween until the following loop.
I have branched the code and updated it slightly so that a tween can be invalidated instantly, with the option of sending a final block/selector with the completed value. I will create a pull request shortly.
Did this fork ever get published I'd really like a simple way to cancel PRTween instances.
I've been looking @ the source and I haven't seen an obvious way to stop/kill a running tween yet. I'll keep looking but something like this should be available.