Skip to content

Instantly share code, notes, and snippets.

@iggym
Last active December 17, 2018 15:41
Show Gist options
  • Select an option

  • Save iggym/5822555 to your computer and use it in GitHub Desktop.

Select an option

Save iggym/5822555 to your computer and use it in GitHub Desktop.
initialize a view controller with nib or storyboard
//To initialize a view controller with a nib file you use initWithNibName.
UIViewController *viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
//Using Storyboard instead of nib files, use the UIStoryboard class
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MyStoryboard" bundle:nil];
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment