I am using Push to navigate to different pages. As you know it always moves right to left. I want it to work like this:
1 – when I click on a button in the left side of the current page, it comes left to right.
2 – when I click on a button in the right side of the current page, it comes right to left.
3 – When I click on the button which loads current page, it comes down to Up. (like Modal)
This is what I tried by implementing UIStoryboardSegue and create custom Segue:
- (void) perform {
UIViewController *src = (UIViewController *) self.sourceViewController;
[src.navigationController popViewControllerAnimated:YES];
}
or:
- (void) perform {
UIViewController *src = (UIViewController *) self.sourceViewController;
[UIView transitionWithView:src.navigationController.view duration:0.5
options:UIViewAnimationOptionTransitionFlipFromBottom
animations:^{
[src.navigationController popToViewController:[src.navigationController.viewControllers objectAtIndex:0] animated:NO];;
}
completion:NULL];
}
But they are not working in a way that I want.
I want them to work like Push Segue (I want the viewDidLoad, … is called again)
Can you give me some help? (Please share some codes in your answer)
This is what I need to do:
Cheers!