0

here is my question, let s say i have UIViewController A B C D... currently I am using the default transiation animiation for all VCs modal transite , shows as -> enter image description here

what i want is... let user pick what kind of transiation animation they like to use..for all the VC modal transition animations... i guess some code need to be added in some where here? ->

- (IBAction)cardAction:(id)sender {
UIImage *img = [(UIButton *)sender currentBackgroundImage];
[self performSegueWithIdentifier:@"cardSegue" sender:img];
}


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
if ([segue.identifier isEqualToString:@"cardSegue"]) {
    UIImage * img = (UIImage *)sender;

    ResultViewController *viewcontroller = [segue destinationViewController];
    viewcontroller.img = img;
    }
}

please help..

sefirosu
  • 2,558
  • 7
  • 44
  • 69

2 Answers2

0

A segue lets you define the transition in the Storyboard but you want to let the user define the transition. UIStoryboardSegue doesn't let you do this, so you're going to need to perform the transition yourself.

There's a good answer on performing transitions using different styles here:

How to change the Push and Pop animations in a navigation based app

Instead of calling performSegueWithIdentifier, you'd use the code from that answer to perform the transition.

Community
  • 1
  • 1
stevex
  • 5,589
  • 37
  • 52
0

You can just create your own segue subclass and then changing the

- (void) perform;

function.

If you need an example for the segue subclassing go to this tutorial:

>>> Link to tutorial <<<

Regards, Nils

Nils Ziehn
  • 4,118
  • 6
  • 26
  • 40