Combining Two Xcode Projects: One with code and on

2019-08-31 04:51发布

I currently have two Xcode projects: my main project that uses storyboard and another Xcode project that contains a single view controller that only uses code (no storyboard). The second view controller (that uses only code) follows this tutorial: http://www.raywenderlich.com/55384/ios-7-best-practices-part-1

I am trying to add the second (code only) project to the project that uses storyboard. I figured I could add in all of the .m and .h files and all of the frameworks as well and then when the user clicks a button they will be brought to that one view controller (the controller seen in the second project). The problem is that I do not know how link the button to the controller. If I made an IBAction for the button, is there any code I can add that would allow me to access the view controller or is it much more complicated than that?

Any suggestions or help is much appreciated.

1条回答
够拽才男人
2楼-- · 2019-08-31 05:51

Since you have a code only view controller and view and with no segue, you should have something like:

//When the button is tapped
-(IBAction)buttonTapped:(id)sender
{
    //initialize the code only controller
    WXController *WXController = [[WXController alloc] init]

    //present the view
    [self presentViewController:WXController animated:YES completion:nil];
}
查看更多
登录 后发表回答