-1

I looked around SO long enough to not find a readily available and absolutely relevant answer to this question, so I am asking for those who have and may, in the future, do the same.

So.. What is the call Order of iOS UIViewController delegate methods, specifically viewDidLoad through viewDidAppear?

lwdthe1
  • 1,001
  • 1
  • 16
  • 16
  • 6
    Possible duplicate of [Looking to understand the iOS UIViewController lifecycle](http://stackoverflow.com/questions/5562938/looking-to-understand-the-ios-uiviewcontroller-lifecycle) – Parth Adroja Nov 22 '16 at 09:20
  • 3
    This has been asked many times man...dont need to create just to answer it yourself – Tj3n Nov 22 '16 at 09:20
  • I guess I did not look hard enough. Tried to delete but somebody else answered it before i could. – lwdthe1 Nov 22 '16 at 09:22

2 Answers2

0

The call order for viewDidLoad through viewDidAppear is as follows:

  1. loadView
  2. viewDidLoad
  3. viewWillAppear
  4. viewDidAppear

For the full lifecyle of an iOS UIViewController, you may find this diagram useful: https://rdkw.wordpress.com/2013/02/24/ios-uiviewcontroller-lifecycle/

lwdthe1
  • 1,001
  • 1
  • 16
  • 16
0

The flow might be changed according to the scenario you're having. Overall possible ways the UIViewController gets invoked is shown below. enter image description here

Please find this for more explanations: Detailed answer

Community
  • 1
  • 1
Saranjith
  • 11,242
  • 5
  • 69
  • 122
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/14367458) – Kundan Nov 22 '16 at 11:31
  • @Shivaay Have added diagram showing the same. Thank you for review. – Saranjith Nov 22 '16 at 11:50