Check an experiment project at Github:
https://github.com/Sylvia-YiyinShen/UILab
The order of the lifecycle functions being called
1. Observe the following check list in viewDidLoad()
In the first view controller after launch, keyWindow is nil.
But it as value in any next view controller pushed later.
2. The alpha value of navigationBar and navigation bar items will be reset automatically to 1 between viewWillAppear and viewDidAppear, set navigationBar to hidden until viewDidAppear and update alpha value in viewDidAppear
3. Carefully check view.bound if the view controller is loaded from Nib
However, view.bounds is correct in viewDidLoad(), if the view controller is created by code or loaded from Storyboard
4. Set public properties values when creating UIView and UIViewController both from nib
The property value is nil in awakeFromNib of UIView,
but it is not nil in viewDidLoad of UIViewController
No comments:
Post a Comment