What are the lifecycle events of UIViewController?
There are some events of the UI view controller:-
This event creates the view that the controller manages. It’s only known as once the view controller is made programmatically. This makes it a superb place to create your views in code.
If just in case the reader of current viewController has not been set nevertheless then this methodology can load the view; however bear in mind, this is often solely out there in iOS >=9.0. Thus if you're supporting iOS <9.0 then do not expect it to come back into the image.
The viewDidLoad event is merely known as once the view is made and loaded into memory. However, the bounds for the view aren't outlined nevertheless. This is often a superb place to initialize the objects that the view controller goes to use.
This event notifies the view Controller whenever the view seems on the screen. During this step, the read has bounds that are outlined. However, the orientation isn't set.
This is the primary step within the lifecycle wherever the boundaries are finalized. If you're not victimization constraints or Auto Layout, you most likely wish to update the subviews here. This is often solely out there in iOS >=5.0. Thus if you're supporting iOS <5.0 then do not expect it to come back into the image.
This event notifies the view controller that the subviews are got the wind off. It’s a superb place to form any changes to the subviews once they need to be set. This is often only out there in iOS >=5.0. Thus if you're supporting iOS <5.0 then do not expect it to come back into the image.
The viewDidAppear occasion fires after the view are introduced on the screen. Which makes it an amazing place to get information from a backend administration or database.
The ViewWillDisappear occasion fires when the perspective on introduced see controller is going to disappear, reject, spread or hole up behind other viewController. This is a correct place where you can confine your system calls, negate clock or discharge objects which are bound to that viewController.
This is the final step of the lifecycle that anybody can address as this occasion fires soon after the perspective on exhibited see controller has been disappeared, rejected, secured or covered up.