1. 程式人生 > >自定義view,AppDelegate等地方,控制器的跳轉方法

自定義view,AppDelegate等地方,控制器的跳轉方法

#pragma mark ---- 跳轉控制器的方法  ---

-(void)jumpViewController
{
    MoreViewController *more = [[MoreViewController alloc]init];
    UIApplication *app =[UIApplication sharedApplication];
    AppDelegate *app2 = app.delegate;
    UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:more];
    app2.window.rootViewController = nav;
    app2.window.rootViewController.modalTransitionStyle =  UIModalTransitionStylePartialCurl;

}

//跳轉控制器的方法2
-(void)jumpViewController2
{
      UINavigationController *nav =[[UINavigationController alloc]initWithRootViewController:vc];
      nav.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
     [self.window.rootViewController presentViewController:nav animated:YES completion:nil];
   

}
//跳轉控制器的方法2
-(void)jumpViewController3
{
      [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:vc animated:YES completion:nil];
}