View Controller Lifecycle Methods
View controllers have a number of methods that are automatically invoked over the controller’s life span. Sometimes, you want to do some setup when the view controller is first initialized. Or you might want to customize the view programmatically before it’s displayed to the user. You can override these lifecycle methods in your view controller subclasses.
Here’s a brief description of each view controller lifecycle method:
• awakeFromNib: If you built the view for your view controller in Interface Builder, then awakeFromNib is called just before the view is unpacked and initialized from the nib file.
• loadView: After awakeFromNib, loadView is called. loadView is where you can programmatically add views to ...