What's the difference between instantiateInitialViewController and instantiateViewControllerWithIdentifier:?

StackOverflow https://stackoverflow.com/questions/23234472

  •  07-07-2023
  •  | 
  •  

Question

If I have a storyboard whose viewcontroller has been tagged. then What's the difference between these 2 APIs?

What I want to know is whether there is some difference on returned object. are they exactly same or one of them will initialize more things?

Was it helpful?

Solution

Use instantiateInitialViewController: to instatiate the default view (initial), this is something you wouldn't do programmatically usually

Use instantiateViewControllerWithIdentifier: when you would like a ViewController And attach a view from the storyboard (storyboard Id (Identifier))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top