I have multiple UIViewControllers in my iOS App's Storyboard. I want to open one of the UIViewControllers (in the storyboard) from a different UIViewController.
I've tried the code below, but it isn't working even though I used it before iOS 5 and it worked fine.
- (IBAction)addNotes:(id)sender {
NotesViewController *notesView = [[NotesViewController alloc] initWithNibName:@"NotesViewController" bundle:nil];
[self presentModalViewController:notesView animated:YES];
}
How can I perform this action with iOS 5 Storyboards?
In swift 4.2 answer for those who want this answer without navigation in modally and in swift updated versions.
Following will work on Swift 3.0 and above.
Update with the Swift 3.1 version
if you haven't embed navigation controller then
and, if you had embed navigation controller then
Assuming you have storyboard, go to storyboard and give your VC an identifier (inspector), then do:
Assuming you have a xib file you want to do:
Without a xib file: