美文网首页iOS开发
iOS根视图切换动画

iOS根视图切换动画

作者: Funcy1Day | 来源:发表于2017-04-10 17:45 被阅读209次

    UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

    UINavigationController *vc = [story instantiateInitialViewController];

    CATransition *animation = [CATransition animation];

    [animation setDuration:0.3];//设置动画时间

    animation.type = kCATransitionReveal;//设置动画类型

    animation.subtype = kCATransitionFromRight;

    [[UIApplication sharedApplication].keyWindow.layer addAnimation:animation forKey:nil];

    self.view.window.rootViewController = vc;

    相关文章

      网友评论

        本文标题:iOS根视图切换动画

        本文链接:https://www.haomeiwen.com/subject/hnfeattx.html