CATransition-转场动画

- (void)animationTrans{
    // 转场动画
    CATransition *anim = [CATransition animation];
    anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    anim.type = @"pageCurl";
    //anim.subtype = kCATransitionFromRight;
    anim.duration = 0.5;

    /**
    [self.navigationController.view.layer addAnimation:anim forKey:@"navAnim"];
    XXXViewController *xxxVC = [[XXXViewController allco] init];
    [self.navigationController showViewController:xxxVC sender:nil];
    **/
    [XXXView exchangeSubViewAtIndex:0 withSubViewAtIndex:1];
    [XXXView.layer addAnimation:anim forKey:@"transAnim"];
}

你可能感兴趣的:(IOS)