1

I have a custom transition from controller A to B, it's just defined like this

@implementation Mycustomsegue
-(void)perform {
    [[self sourceViewController] presentViewController:[self destinationViewController] animated:NO completion:^{
    }];
}
@end

Now, when unwinding from B to A, it looks like a modal dismissal of controller B. How can I remove this? I don't want any animation or I want to control it.

Jonny
  • 15,955
  • 18
  • 111
  • 232
  • How do you dismiss ? Have you used `animated:YES` there? In presenting it looks fine with `animated:NO` – NeverHopeless Feb 18 '14 at 06:25
  • By implementing this in controller A, then hooking up a button to it in controller B (using storyboard) `-(IBAction)unwindToTop:(UIStoryboardSegue *)segue { }`. There is no place to set Mycustomsegue with unwind segues as far as I could see. – Jonny Feb 18 '14 at 06:32
  • This answer: http://stackoverflow.com/a/19956258/129202 helped me for now. I needed to subclass the main nav controller and add a method which eventually is called on controller A, which instantiates the Mycustomsegue to which I had to add a BOOL unwind property. Instantiate that, set the property to YES, then in the perform of the Mycustomsegue, call dismiss*** instead of present*** ... kind of long winded workaround but seems to work so far. – Jonny Feb 18 '14 at 06:47

1 Answers1

2

Create simple action method and connect it to storyboard.

Try below code

- (IBAction)actionDismiss:(id)sender {

[self dismissViewControllerAnimated:NO completion:nil];

}

Select you segue and goto attribute inspector
and set you custom class name in this case "Mycustomsegue"

enter image description here

bhavya kothari
  • 7,484
  • 4
  • 27
  • 53
  • So my previous solution didn't work, it just messed up other things around my app. I gave this a try, and it seems to work for now. Thanks. – Jonny Feb 18 '14 at 09:49