This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ## inserting. this can be done in viewDidLoad | |
| // this can be any view, here I'm adding to main view | |
| UIView *containerView = self.view; | |
| // load child controller | |
| UIViewController *svc = [[UIViewController alloc] initWithNibName:nil bundle:nil]; | |
| // kill the randomness | |
| svc.view.translatesAutoresizingMaskIntoConstraints = NO; | |
| // add child VC to hierarchy | |
| [self addChildViewController:svc]; | |
| // set initial rect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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.view removeFromSuperview]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2013 Calvin Rien | |
| * | |
| * Based on the JSON parser by Patrick van Bergen | |
| * http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
| * | |
| * Simplified it so that it doesn't throw exceptions | |
| * and can be used in Unity iPhone with maximum code stripping. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining |