push to another view controller without prepareForSegue

前端 未结 4 636
别那么骄傲
别那么骄傲 2020-12-30 08:01

How can you push to another view controller without prepareForSegue?

myClassVC *viewController = [myClassVC alloc];
UIStoryboardSegue *segue = [         


        
4条回答
  •  旧巷少年郎
    2020-12-30 08:39

    In my case all viewControllers are built dynamically. I do not make use of the storyboard for this purpose. Should this be your case you may just instantiate the viewController class you want to open and make a push as in my example below:

    MyViewController* myViewController = [[MyViewController alloc] init];
    [self.navigationController pushViewController:myViewController animated:YES];
    

提交回复
热议问题