Search code examples
iosuistoryboarduistoryboardsegue

How to create a non animating unwind custom segue


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.


Solution

  • 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