viewDidLoad is a good place to create and initialize the sub items that you want to add to your main view. It is also a good place to further customize your main look. This is also a good place to initialize data structures, because by the time it was called, some properties had to be set on the view controller. Usually this needs to be done only once.
viewWillLayoutSubviews is the place where you place and place subitems, if necessary. This will be called after turns or other events, which will cause the view controller to be set. This can happen many times during the life of a view controller. You should only post submissions here.
source share