In iPhone, when we use push Segue in Storyboard, it always navigates from right
to left
. Can we implement any mechanism that it navigates left
to right
, or down
to top
?
I know about how to create Custom
Segue, but it does not work the same like Push
. Can you help me?
Open Main. storyboard and select the segue named Show segue to “Choose Game”. Then from the Attributes inspector change its Identifier to PickGame. If the segue's identifier is PickGame, cast the destination view controller as GamePickerViewController so you can access its properties.
Assigning an identifier for the segue:Select the segue, from the attribute inspector you'll see "Identifier" text field, that's it! make sure to insert the exact same name that used in performSegueWithIdentifier .
If you are developing an App for iOS 5, you can create a class that implement UIStoryboardSegue (to have custom segue), and then override the Perform
method in this way:
-(void)perform {
UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
UIViewController *destinationController = (UIViewController*)[self destinationViewController];
CATransition* transition = [CATransition animation];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[sourceViewController.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[sourceViewController.navigationController pushViewController:destinationController animated:NO];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With