Skip to content

Instantly share code, notes, and snippets.

@anknetau
Created February 3, 2016 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anknetau/75062374a9bc45f1a2d8 to your computer and use it in GitHub Desktop.
Save anknetau/75062374a9bc45f1a2d8 to your computer and use it in GitHub Desktop.
Add a child view controller
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"identifier"]; // or whatever
[self addChildViewController:controller];
controller.view.frame = CGRectMake(0, 0, 100, 100); // or whatever
[self.view addSubview:controller.view];
[controller didMoveToParentViewController:self];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment