Saturday, May 02, 2015

IOS programatically jump to another view

1st, create a segue between your current view and the view you want to jump to. e.g, ViewMe and ViewLogin. Set the set identity of the segue to like 'Me2LoginSegue'.

2nd,  Ctrl+drag the button to the .h file,  create an action name like 'onClickLoginSubmit'.

3rd, put this code into the method you created in the .m file.  like this
- (IBAction)onClickLoginSubmit:(id)sender {
    [self performSegueWithIdentifier: @"Me2LoginSegue" sender: self];
}

@end

Done

No comments: