I know how I can get a button to open a new ViewController(new class) in the storyboard by dragging and dropping. But I need a code that I can write in the .m file that opens a new View when my button is clicked.
In my FirstViewController.m i got:
- (IBAction)button1:(id)sender {
}
What code do i need in this to get the button to open the SecondViewController?
The @”TheSequeName” is defined when you ctrl drag a button to open a new view controller on the storyboard
If you don’t use segue, there are many variants to open a new view controller. The basic one is using a separate NIB (without storyboard)
If you declare your view controller on Storyboard, you can use
Then you show your SecondViewController using navigation controller
Or as modal view