Wednesday, 11 September 2013

Animating object inside UIPageViewController

Animating object inside UIPageViewController

I have a button inside UIPageViewController. I added animation to it
(hide/show)
Once I go to another controller by clicking other buttons then I go back
to the the view controller with animating button, I couldn't click any
button anymore.
I tried to remove the animation on the button and everything works fine
again so I'm guessing it's the animation that I'm having a problem with.
Here's my code for the button's animation:
CABasicAnimation *theAnimation;
theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration=1.0;
theAnimation.repeatCount=3;
theAnimation.autoreverses=YES;
theAnimation.fromValue=[NSNumber numberWithFloat:1.0];
theAnimation.toValue=[NSNumber numberWithFloat:0.0];
[helloGuestButton.layer addAnimation:theAnimation
forKey:@"animateOpacity"];

No comments:

Post a Comment