1
votes

I have a view controller in a storyboard as in , image

I'd included the following code to show the particular view controller, but the problem is, no matter what code I use to make the transition, as if it's being pushed from side of screen(like xib's push), it always shows up from bottom.

 UIStoryboard * storyboard = self.storyboard;    
  DashboardViewController * dbvc = [storyboard instantiateViewControllerWithIdentifier:@"NavigForHomePage"];  
[self.navigationController showViewController: dbvc sender:self];

I tried with pushViewController(also Xcode says push is deprecated), but then the navigation bar disappears.

My storyboard has a navigationcontroller initially, from which I'd linked the other view controller's by ctrl+drag and the storyboard segue kind is show(e.g.push), but in-between - just for the dashboardviewcontroller, I included another navigationcontroller with a different navigation bar, is that a mistake?

I couldn't understand this concept, my question is how to get normal push like transition? any help would be appreciated thanks.

3

3 Answers

0
votes
UIStoryboard * storyboard = self.storyboard;
DashboardViewController * dbvc = [storyboard instantiateViewControllerWithIdentifier:@"NavigForHomePage"];
[self.navigationController pushViewController:dbvc animated:YES];
0
votes

Just Change the following line

[self.navigationController showViewController: dbvc sender:self];

To

[self.navigationController pushViewController: dbvc animated:YES];
0
votes

NOTE : According to image, You are connect view-Controller to Segue, Then Why you are push controller use of Code. Doesn't required code, Because you connect view-controller with segue.

May Be, You are segue selected Kind Type is Present Model, Click on segue and change is show (Push). See image :

enter image description here