0

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.

Ryan E
  • 45
  • 1
  • 10

1 Answers1

0

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];
}
veovo
  • 191
  • 7
  • Don't capitalize and prefix local variable names. The local variable in your example should be `controller` with a lowercase 'c', not `WXController`. – jlehr Jul 19 '14 at 21:33
  • @jlehr This didn't seem to present the ViewController as I had ran into a few errors when running the project. If my previous project asks that I use the .xcodeproj and the weather application requires that I use the .xcworkspace, which one should I use if I am trying to combine the two? – Ryan E Jul 28 '14 at 01:12