Hello all !!
Explanation of the topic is :--
Whenever we have to move from one controller to another we usually do it by performing Segue between the two view controllers in the MainStoryboard..
The segue requires an identifier and from where we have to move to next controller we implement the code for it.. This is one way.
Alternatively, for doing so we can provide Storyboard ID and then just perform the following code to move from one controller to any other controller.
This method prevents from remembering the segues between the several view controllers and we can directly use the identifier of the controller in which we want to push/pop the view..
Here's the code !!
DestinationViewController *comments = [self.storyboard instantiateViewControllerWithIdentifier:@"commentsControllerIdentifier"]; // DestinationViewController is the next controller where we want to go.
[self.navigationController pushViewController:comments animated:YES];
0 Comment(s)