push to another view controller without prepareForSegue

前端 未结 4 633
别那么骄傲
别那么骄傲 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:35

    [self presentViewController:viewController animated:YES completion:nil]; is not needed, as the segue will push the destination view controller using the transition you selected automatically.

    If you don't want to use the segue process you'll need to manually push the view controller with:

    [self presentViewController:viewController animated:YES completion:nil];

    but make sure you remove the segues in the Storyboard first.

提交回复
热议问题