6

I read a great explain about unwind segues from here: What are Unwind segues for and how do you use them? Then tried in my own project, everything works fine, only one question, as the "push segue" Xcode provides, the unwind segues perform with animation by default, I have to use a custom push segue to get rid of the animation followed by this:Push segue in xcode with no animation

#import <UIKit/UIKit.h>

@interface PushNoAnimationSegue : UIStoryboardSegue

@end

#import "PushNoAnimationSegue.h"

@implementation PushNoAnimationSegue
-(void) perform{
    [[[self sourceViewController] navigationController] pushViewController:[self destinationViewController] animated:NO];
}
@end

what can I do to turn off the animation of unwind segues as well. Can anyone help?

Community
  • 1
  • 1
Jillian
  • 61
  • 3
  • 1
    Apple has implemented unwind into sample project, take a look https://developer.apple.com/library/iOS/samplecode/UnwindSegue/Listings/CustomUnwindSegue_QuizContainerFadeViewControllerSegue_m.html#//apple_ref/doc/uid/DTS40013644-CustomUnwindSegue_QuizContainerFadeViewControllerSegue_m-DontLinkElementID_6 and you can set animation to no – Retro Dec 31 '13 at 19:58

1 Answers1

3

For iOS9:

Interface Builder (in Xcode 7) lists unwind segues. From there, you can select it and simply uncheck the animated property to turn off the unwind animation.

Animates property of an unwind segue

For iOS 7 and 8:

In the unwind method of the destination controller you have to pop with animated: NO.

Raphaël
  • 3,646
  • 27
  • 28