Reputation: 4708
I'm new to Xcode.I'm trying to figure out how to use showViewController.My question is how to call the UIViewController that to display ? via name or a identifier? And where can I find them ? In addition, the document says The default implementation of this method calls the targetViewControllerForAction:sender: method to locate an object in the view controller hierarchy that overrides this method
,what does it mean? Should I call targetViewControllerForAction:sender:
fist when using showViewController
?
Upvotes: 0
Views: 1674
Reputation: 143
showViewController behavior basically depends on context you're app is in. But calling it is really simple. All you need is reference to your UIViewController object(or it's subclass). You can do it in couple of different ways:
So: not worry about this targetViewController
method, just get your object (initialize it via constructor or get it from storyboard), and pass it to show method.
In case you have further questions - feel free to ask.
Upvotes: 2