Instantly share code, notes, and snippets.

Andres Kievsky anknetau

View GitHub Profile
View keybase proof
### Keybase proof
I hereby claim:
* I am anknetau on github.
* I am ank ( on keybase.
* I have a public key whose fingerprint is 9534 E157 8B32 46F0 9C8F 8B2F 4EBE 7B2D 30EA E859
To claim this, I am signing this object:
View gist.m
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];
View gist.m
UIViewController *vc = self.childViewControllers[3]; // or whatever
[vc willMoveToParentViewController:nil];
[vc.view removeFromSuperview];
[vc removeFromParentViewController];
View Remove leading and trailing spaces
NSString* result = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];