Created
June 4, 2013 02:00
-
-
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)
This file contains 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
// 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