Why is this CAT transition not working?

I am trying to translate the text of UILabel :

 CATransition *animation = [CATransition animation]; animation.duration = 4; animation.type = kCATransitionReveal; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; [label.layer addAnimation:animation forKey:nil]; label.text = resultDateStr; 

This works great. But when I installed it in kCATransitionFade , it stops working. Tested on iOS 4.3 and 5.0 Any idea?

+6
source share
2 answers

try it

 [CATransaction begin]; CATransition *animation = [CATransition animation]; animation.type = kCATransitionFade; animation.duration = 3.50; [self.view addSubview:mySecondUIView] [[self.view layer] addAnimation:animation forKey:@"Fade"]; [CATransaction commit]; 
0
source

Make sure that you perform this task in the main thread.

0
source

Source: https://habr.com/ru/post/910465/


All Articles