Skip to content

Instantly share code, notes, and snippets.

View anknetau's full-sized avatar

Andres Kievsky anknetau

View GitHub Profile
@anknetau
anknetau / Remove leading and trailing spaces
Last active August 29, 2015 14:02
Removing start and end spaces of an NSString is very simple
NSString* result = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
@anknetau
anknetau / gist.m
Created February 3, 2016 02:57
Remove a child view controller
UIViewController *vc = self.childViewControllers[3]; // or whatever
[vc willMoveToParentViewController:nil];
[vc.view removeFromSuperview];
[vc removeFromParentViewController];
@anknetau
anknetau / gist.m
Created February 3, 2016 02:58
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];
### Keybase proof
I hereby claim:
* I am anknetau on github.
* I am ank (https://keybase.io/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: