Powered by
Powered by
HuntMyIdeas-Inspire You To Make It Happen
Follow
   Me
  • Blogs
  • About Me
  • Home

How To Explain UIViewController Life Cycle in iOS?

8/19/2018

0 Comments

 
What is VIewController?
View controllers play a crucial role for designing most iPhone applications.Today, I am going to explain only the UIViewController Life Cycle.The UIViewController class is the base class that establishes communication between model and View in iOS MVC design
pattern.
The life cycle of a View is defined by some methods that can be overridden in many classes that inherits from UIViewController.

​While we are loading a view into the screen, some events will be fired as explained here.

Read:

How to use NSURLConnection in iOS ?

Read:
Basic iOS interview Questions And Answers 
Top 5 Frequently Asked iOS Interview Questions And Answers.
Top  Interview Questions And Answers in Objective C
Most Important iPhone interview Questions and Answers

loadView:

UIViewController's code will call the loadView method to create the view for the view controller. The code of UIKit will call the loadView method if and when it actually needs to present that controller's view hierarchy on screen.As per the apple's documentation, no need to call these methods directly.You can just ignore these method ,if you are using storyboard. Its implementation in UIViewController loads the interface from the interface file and connects all the IBOutlets and IBActions for you.

ViewDidLoad: 

This is one of the the most important events in view Controller's life cycle .UIViewController calls this method when the view has been created and loaded into memory along with all outlets.This method is called automatically when the view is already created programmatically or loaded from XIB.
Picture
ViewWillAppear():

This method is called just before the view added to the display hierarchy. This method to update the user interface with data that might have changed while the view controller was not on the screen.
Note:
This event can be called many times for the same instance of a view controller

ViewDidAppear():
This method is called  when the view is added to the screen.Usually,starting animations in the user interface,a sound, or to start collecting data from the network can be implemented here.

Read:
How to  get 1024x1024 icon from iTunes Connect ?
​
iOS - How to implement Local Notifications using Objective C

ViewWillDisappear():
This method is called prior to removing the view from the display hierarchy. If you override this method, you must always call base.ViewWillDisappear(). It's a good idea to undo anything that you implemented in ViewWillAppear() or ViewDidAppear().

ViewDidDisappear():
​

This method is called after the view is removed from the display hierarchy.

DidReceieveMemoryWarning().

 This method can also be called when the view has already disappeared from the display hierarchy, which would normally occur if you have left large objects in memory and the system needs to dispose them to make room for other processes. If you override this method, you must always.
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Delivered by FeedBurner

    RSS Feed

    Archives

    December 2019
    August 2018
    January 2018
    December 2017
    November 2017
    October 2017
    August 2017
    April 2017
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014


    ​​Categories

    All
    Affiliate Marketing
    Alexa Rank
    Apple's Latest Updates
    Blog Tips
    Cocos2d X
    Cocos2d-x
    Google AdSense Tips
    Grab-some-ultimate-ideas
    How-to-create-a-twinkling-star-background-effect-in-ios
    In-App Purchase Tutorial In Cocos2d-x (C++) Using SDKBOX
    Ios Interview Questions And Answers
    IOS Multiple Choice Questions And Answers
    Objective C
    Online Business
    Python
    Secrets To Effective IPhone App Marketing
    SEO Tips
    Swift Interview Questions
    Swift Tutorials
    Top 10 Articles Objective C
    Top 10 Articles-Objective-C
    Top 10 Popular Movies Ever
    Top 10 Popular Things To Know
    Top 10 Ultimate Issues Xcode
    Top 400 IOS Interview Questions
    Top IOS Sample Projects To Learn From
    Top Secrets To App Marketing
    UICollectionView
    Unity 3D
    Xcode

WELCOME TO HUNTMYIDEAS

Picture
I am Jitendra Gochhayat,an iOS Developer,Designer,blogger,
​from Odisha,India.
I write about ​​​blog tips and,
Make money online Tips,
​Objective C tutorials
SUSCRIBE TO NEWSLETTER

    Subscribe to this blog and receive notifications of new posts by email

Suscribe
Picture
Picture
Picture
Picture
Picture
HuntMyIdeas-2016 Powered By Weebly
Picture
Powered by Create your own unique website with customizable templates.
Powered by
Powered by