Reputation: 23134
Here is a screenshot from Xcode 8.2:
If the function does not exist, how do you add identifier to a view controller these days?
Upvotes: 4
Views: 3128
Reputation: 3730
Use instead instantiateViewController(withIdentifier:)
when you would like a ViewController
and attach a view from the storyboard (UIStoryboard Id Identifier
)
instantiateInitialViewController()
is to instantiate the default view initial
, this function takes no argument and is something you wouldn't usually do programmatically.
Upvotes: 5
Reputation: 2762
let sb = UIStoryboard(name: "", bundle: Bundle.main)
sb.instantiateViewController(withIdentifier: "blue")
Upvotes: 4