Home > DeveloperSection > Forums > How to push a view controller to another view controller
ezra heywood
ezra heywood

Total Post:145

Posted on    November-25-2015 7:31 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 578  View(s)
Rate this:
I am new in iPhone development, so I want to know how can I push one view controller to another view controller using animations.
I have added a Next button. whenever I click that button I am pushing one view controller to another view controller.
Please help me.

Tarun Kumar

Total Post:214

Posted on    January-18-2016 11:18 PM

If you want to push one view to another view controller then you need to implement below code in action method of your Next button:

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
ImageViewController *imageViewController = (ImageViewController*)[mainstoryboard instantiateViewControllerWithIdentifier:@"ImageViewController"];

or in short you can use above code like this:

ImageViewController *imageViewController = [self.storyboard instantiateViewControllerViewIdentifier:@"ImageViewController"];

I hope above code is helpful for you.

Don't want to miss updates? Please click the below button!

Follow MindStick