Call storyboard scene programmatically (without needing segue)?

前端 未结 8 820
既然无缘
既然无缘 2020-12-04 10:10

I have a modal storyboard scene that I want to be accessible to all my other scenes. Creating a modal segue to it from every scene on my storyboard creates a big mess of str

8条回答
  •  时光说笑
    2020-12-04 10:23

    Just call viewcontroller using navigation controller Write this code in viewcontroller and set viewcontroller in storyboard as set in the image.

    ProfileVC *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ProfileVC"];
    [self.navigationController pushViewController:vc animated:YES];
    

提交回复
热议问题