0

In Xcode, making an iOS 5 app, I have one view in the StoryBoard and I have a method in its controller class - which if invoked (happens when return is pressed on keyboard) needs to move the app to another screen view.

However I am struggling to get my head around exactly how to create another view for my app. I know that if I go to MainStoryboard.storyboard I can drag a View Controller object out onto it, but I don’t understand what this is actually making.

It seems to make a “View Controller Scene” in the Document Outline panel, but I don’t entirely understand how to set its controller class. Am I even vaguely close to the correct way of making new views for an app?

Also I can use a button to segue into this new view controller (by control + drag), but I’m not sure how I’d do this in code (such as within the method mentioned above).

Hopefully you’ll be able to make sense to me how to make views and move between them. Any help would be greatly appreciated :-)

Trott
  • 66,479
  • 23
  • 173
  • 212
Jon Cox
  • 10,622
  • 22
  • 78
  • 123

1 Answers1

1

To set the class of a view controller you should do this in the identity inspector in interface builder. This will let you select your custom view controller class. To make a view transition to another view by connecting a segue you should add something like a button and right click and drag out a segue across to the view controller you want to transition too you will then be presented with a popup which lets you specify the type of transition e.g modal push etc.

For more on this check out my tutorial that should really help you here.

Scott Sherwood
  • 3,108
  • 25
  • 30