When you create a view controller in a storyboard, the attributes you configure in Interface Builder are serialized into an archive. Later, when the view controller is instantiated, this archive is loaded into memory and processed. The result is a set of objects whose attributes match those you set in Interface Builder. The archive is loaded by calling the view controller’s initWithCoder:
method.
Then, the awakeFromNib
method is called on any object that implements that method, awakeFromNib gets called after the view and its subviews were allocated and initialized. It is guaranteed that the view will have all its outlet instance variables set. You use this method to perform any configuration steps that require other objects to already be instantiated. For detail refer ViewController programming guide