Skip to content

Instantly share code, notes, and snippets.

@armstrongnate
Created June 4, 2013 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armstrongnate/5703059 to your computer and use it in GitHub Desktop.
Save armstrongnate/5703059 to your computer and use it in GitHub Desktop.
how to call awakeFromNib method inside View Controller (method that gets called before viewDidLoad, mostly used for geometry changes)
// the following class inherits from UIViewController
@implementation MyCustomViewController
- (void)setup
{
// initialization that can't wait until viewDidLoad
}
- (void)awakeFromNib
{
[self setup];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
[self setup];
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment