Balabama Balabama - 1 year ago 108
iOS Question

How to open new view controller after click button?

I added one

to my project and created one class.
After I bind this class to my

In another controller I have method:

- (IBAction)login:(id)sender {
// How here I can do redirect to controller


Answer Source

There are two ways to push view controllers in the application.

1) by Segue

2) By View controller identifier

1) By Segue :

[self performSegueWithIdentifier:"SegueIdentifier" sender:self];

2) By View controller identifier :

Yourclassname *gotoYourClass = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewControllerIdentifier"];

[self.navigationController pushViewController:gotoYourClass animated:YES];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download