I applied the blinking animation to the contentView
of the tableViewcell
for a table in First viewController of the splitviewController. My problem is, the animation stops when I hide the FirstViewcontroller with presentsWithGesture
property of splitViewController
I have subclassed UItableViewCell and I add animation while setting a property and
I added the animation to the contentView
of cell
like below
-(void)setProperty:(Property *)aProperty
{
_property=aProperty;
[self.contentView addSubview:self.dateLabel];
self.dateLabel.text=[self.meeting stringforScheduleDate];
if (_property.opened) {
CABasicAnimation *theAnimation;
CALayer *layer=[self.contentView layer];
theAnimation=[CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration = 0.5;
theAnimation.delegate=self;
theAnimation.fromValue = [NSNumber numberWithFloat:0.0];
theAnimation.toValue = [NSNumber numberWithFloat:1.0];
theAnimation.repeatCount=HUGE_VALF;
theAnimation.autoreverses=YES;
// [layer removeAnimationForKey:@"opacity"];
[layer addAnimation:theAnimation forKey:@"opacity"];
}
else
{
CALayer *layer=[self.contentView layer];
[layer removeAnimationForKey:@"opacity"];
}
}
I don't know whether it is ViewController's behavior to stop core animation in it's view hierarchy when hidden or do I have missed something in my code. So help me out peers