Can I cancel the CATransaction completionBlock?
Asked Answered
W

1

11

In a CATransaction I have the following code:

[CATransaction setCompletionBlock:^{
    ...do something ....
}];

The animation runs for about half a second. I want to be able to cancel the completion block if some other events happen in the class logic...

Is there a way to prevent this block to run after the animation has started?

Woeful answered 23/5, 2014 at 19:0 Comment(3)
Did you ever find an answer to this problem?Arvid
@JoshGafni No, I have changed my class logic to work around this.Woeful
Thanks anyway! Seems like functionality Apple should add.Arvid
O
1

Try to add some logic that will check state of other events. Somthing like this:

[CATransaction setCompletionBlock:^{
    if(some other events happen){
       return;
    }
}];
Onega answered 16/10, 2015 at 10:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.