In my storyboard I drag on a new View Controller. My Storyboard now has two view controllers: the main one that came when I created the file, and the one a dragged on.
When I go into the 'assistant editor' and select the main view controller, I get the ViewController.h class. But when I select the other controller I get UIViewController.h which is an Apple file.
How do I link/create these classes for each View Controller? Is there an automated way to do this, or am I not doing it right.
You need to create your own subclass of UIViewController and set the newly created view controller as the custom class in the storyboard.
- Press cmd+n or go to File > New File
- Select Objective-C class and hit next
- Type UIViewController into the second box and type a name for the new class in the first box (which will be something like MyClassViewController)
- Go into your storyboard, select the View Controller you dragged out, look at the inspector and go to the Custom Class Tab and set the custom class to your newly created view controller (e.g. MyClassViewController)