What's the difference between instantiateInitialViewController and instantiateViewControllerWithIdentifier:?

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

  •  07-07-2023
  •  | 
  •  

Вопрос

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?

Это было полезно?

Решение

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))

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top