因为remove了view,所以动画不能在自身的图层,可以加载其superview上, 要么加载时有个延时,让动画显示之后再remove图层。
{
CATransition *transition = [CATransitionanimation];
transition.duration =0.5f;
transition.timingFunction = [CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type =kCATransitionReveal;
transition.subtype =kCATransitionFromLeft;
transition.delegate =self;
[transitionsetValue:@"popview"forKey:@"animType"];
[self.userLoginViewController.navigationController.view.layer
addAnimation:transition forKey: nil];
}
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
if([[animvalueForKey:@"animType"]isEqualToString:@"popview"]) {
[self.userLoginViewController.navigationController.viewremoveFromSuperview];
}
}