0
votes

I've one query regarding redirect from View controller to main story board In my IOS app. In My application login screen is Main Storyboard and register screen is view controller. I know code of redirect from Main Story board (Login) to view controller (register) but i don't know how to redirect back from View controller (Register) to Main storyboard (Login).

Any help will be appreciated :)

Thanks Shailesh

1
How are you going from Login to register? How you go back depends on how you go forward.rdelmar
Hi, Thanks for your reply. Please check out below code that i use to redirect from login(main storyboard) screen to register (view controller) screen. UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; Register *mvc = [sb instantiateViewControllerWithIdentifier:@"Register"]; mvc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentViewController:mvc animated:YES completion:NULL]; Thanks1Shailesh
In mvc just put [self dismissViewControllerAnimated:YES completion:nil];rdelmar
Hi, Thanks it works for meShailesh
I've one more question How can i redirect from One view controller to another view controller. Is it same as Main story board to another view controller?Shailesh

1 Answers

0
votes

just write one line code

-(IBAction)dismiss:(id)sender
{
[self dismissViewControllerAnimated:YES completion:Nil];

}