Skip to content

Instantly share code, notes, and snippets.

View rsimenok's full-sized avatar

Roman Simenok rsimenok

  • Ukraine, Kyiv
View GitHub Profile
@rsimenok
rsimenok / childView.m
Last active November 24, 2015 17:39 — forked from tomohisa/gist:2897676
Add and Remove ChildViewController
// add child view
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"];
[self addChildViewController:controller];
controller.view.frame = CGRectMake(0, 44, 320, 320);
[self.view addSubview:controller.view];
[controller didMoveToParentViewController:self];
// remove child view
UIViewController *vc = [self.childViewControllers lastObject];
[vc willMoveToParentViewController:nil];