I have a project that has a view controller as a start screen, and then a view controller built into the navigation view controller. I also have a button on the first screen, the click of which I want to open the screen of the navigation controller.
I clicked on the button and then on the “connection inspector”, I added a push event for this navigation controller, but segue does not happen. How can I achieve this, please?
DECISION
Finally, after a little research, I managed to get this work to work. Here is the code I'm using:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSLog(@"Source Controller = %@", [segue sourceViewController]);
NSLog(@"Destination Controller = %@", [segue destinationViewController]);
NSLog(@"Segue Identifier = %@", [segue identifier]);
if ([segue.identifier isEqualToString:@"mysegue"])
{
NSLog(@"coming here");
SecondViewController *loginViewController = (SecondViewController *)segue.destinationViewController;
[self presentModalViewController:loginViewController animated:YES];
}
}
source
share