放松segues ---动画

时间:2013-12-31 19:21:00

标签: ios uistoryboardsegue

我从这里读到了关于展开segues的一个很好的解释: What are Unwind segues for and how do you use them? 然后尝试在我自己的项目中,一切正常,只有一个问题,正如Xcode提供的“推送segue”,默认情况下展开的segues执行动画,我必须使用自定义推送segue来摆脱动画,然后这个: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

我还能做些什么才能关闭展开细分的动画。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:3)

对于iOS9:

Interface Builder(在Xcode 7中)列出了展开的segues。从那里,您可以选择它,只需取消选中animated属性即可关闭展开动画。

Animates property of an unwind segue

对于iOS 7和8:

在目标控制器的unwind方法中,您必须弹出animated: NO