PRTween icon indicating copy to clipboard operation
PRTween copied to clipboard

Cancel a running tween?

Open edolecki opened this issue 12 years ago • 3 comments

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.

edolecki avatar Dec 12 '12 13:12 edolecki

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.

avaidyam avatar Jan 20 '13 16:01 avaidyam

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.

jowie avatar Jun 14 '13 15:06 jowie

Did this fork ever get published I'd really like a simple way to cancel PRTween instances.

kallipigous avatar Oct 30 '14 14:10 kallipigous