Call a view controller programatically using storyboard id iOS

后端 未结 3 832
离开以前
离开以前 2021-01-22 00:10

What I Want?

  • In MainViewController I open a view from a xib programmatically. This xib view contains a UIButton. The xib opens successf
3条回答
  •  失恋的感觉
    2021-01-22 00:57

    Try this

    UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    FeedBackViewController * feedbackVC = [story   instantiateViewControllerWithIdentifier:@"FeedBackView"] ;
    [self presentViewController:feedbackVC animated:YES completion:nil];
    

    Where FeedBackView is your storyboard id of FeedBackViewController.

提交回复
热议问题