Skip to content

Instantly share code, notes, and snippets.

@olegtyshcneko
Created December 5, 2015 10:57
Show Gist options
  • Select an option

  • Save olegtyshcneko/edf9f697c822ae3691b0 to your computer and use it in GitHub Desktop.

Select an option

Save olegtyshcneko/edf9f697c822ae3691b0 to your computer and use it in GitHub Desktop.
xamarin ViewController add child helper
private void AddViewControllerAsChild(UIViewController child, UIViewController parent) { child.WillMoveToParentViewController(parent); parent.AddChildViewController(child); parent.View.AddSubview(child.View); child.DidMoveToParentViewController(parent); } private void RemoveChildViewController(UIViewController child) { child.WillMoveToParentViewController(null); child.RemoveFromParentViewController(); child.View.RemoveFromSuperview(); child.DidMoveToParentViewController(null); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment