Pergunta

I got half screen view and it appear with animation then I tap appearButton. Then I tap on the screen - it disappear with animation. But if I tap on the appearButton and my view on the screen it disappear with half animation and new view not appear.

I want that then I do it my current view will be disappear and new view will be appear then previous is disappear. So is it any method that says that view now is animating and the next animation will start only then current will finished?

I can not use completion block because my disappear animation run from - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event and only then I tap on everything on the screen, Of course, I tried to use it but it not works like I need

Foi útil?

Solução

One option can be a flag that becomes YES when you call the first animation and becomes NO on the completion block, so in the second animation you know if an animation has started and hasn't finished.

You can also try using the UIViewAnimationOptionBeginFromCurrentState key in the second animation.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top