1) loadView- Only called when view controller is created and only when done programitcally. Bounds are incorrect (normally empty) at this point.
2) viewDidLoad - Only called when view controller is created. Bounds are incorrect (normally empty) at this point.
3) viewWillAppear - Called whenever the view is presented on screen
4 )viewWillLayoutSubviews - This is the first method where we have the correct bounds for the device and is called whenever the view controller is changing the display of the view (like device orientation, view loaded) or the UIView is marked as needing a layout
5) layoutSubviews - This method is called on the UIView rather than the UIViewController. It has the correct bounds. Great place to change layout.
6)viewDidLayoutSubviews - Called after layoutSubviews is called on UIView. Changes made in layoutSubviews can be animated, further changes made in this method can cancel the animations.
7) viewDidAppear - Called once the view has appeared. It has the correct bounds but changes called here can happen after an animation has occurred and cause a slight jump.
No comments:
Post a Comment