Presentar Storyboard ViewController desde otro ViewController

Tengo múltiples UIViewControllers en el Storyboard de mi aplicación iOS. Quiero abrir uno de los UIViewControllers (en el storyboard) de un UIViewController diferente.

He intentado el código a continuación, pero no funciona aunque lo utilicé antes de iOS 5 y funcionó bien.

- (IBAction)addNotes:(id)sender { NotesViewController *notesView = [[NotesViewController alloc] initWithNibName:@"NotesViewController" bundle:nil]; [self presentModalViewController:notesView animated:YES]; } 

¿Cómo puedo realizar esta acción con iOS 5 Storyboards?

Suponiendo que tiene storyboard, vaya a storyboard y proporcione a su VC un identificador (inspector), luego haga lo siguiente:

 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"]; [self.navigationController pushViewController:vc animated:YES]; 

Suponiendo que tiene un file xib que desea hacer:

 UIViewController *vc = [[UIViewController alloc] initWithNibName:@"NIBNAME" bundle:nil]; [self.navigationController pushViewController:vc animated:YES]; 

Sin un file xib:

 UIViewController *vc = [[UIViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES]; 

Aquí está la versión Swift

StoryBoard

 let storyBoard = UIStoryboard(name: "Main", bundle: nil) let mainViewController = storyBoard.instantiateViewControllerWithIdentifier(“Identifier") self.navigationController?.pushViewController(mainViewController, animated: true) 

.xib

  let viewController = UIViewController(nibName: "NibName", bundle: nil) self.navigationController?.pushViewController(viewController, animated: true) 

Sin .xib

 let viewController = UIViewController() self.navigationController?.pushViewController(viewController, animated: true) 
 UIViewController *initialHelpView = [[UIStoryboard storyboardWithName:@"StoryBoard_IDentifier" bundle:nil] instantiateViewControllerWithIdentifier:@"ViewController_Identifier"]; [self presentViewController:initialHelpView animated:YES completion:nil]; 

Actualización con la versión Swift 3.1

Si no ha integrado el controller de navigation, entonces

 let storyBoard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let viewController2 = storyBoard.instantiateViewController(withIdentifier: "ViewController2") self.present(viewController2, animated: true, completion: nil) 

y, si hubiera integrado el controller de navigation, entonces

 let storyBoard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let viewController2 = storyBoard.instantiateViewController(withIdentifier: "ViewController2") self.navigationController?.pushViewController(viewController2, animated: true)