在Storyboard风格中没有动画的presentModalViewController

时间:2011-12-09 05:17:48

标签: iphone ios5 segue xcode-storyboard

我有一个使用传统nib接口文件创建的现有iPhone应用程序。现在我要将应用程序转换为iOS5故事板样式界面。我已经改变了几乎所有的接口文件并且工作正常。

但我是小问题。我的Exsiting应用程序有presentModalViewController:animated:的代码,没有动画。这是通过将NO设置为动画属性。我对使用segues做同样的问题。我找不到任何属性来禁用segues中的动画。

1 个答案:

答案 0 :(得分:10)

我使用自定义segue解决了上述问题。我通过扩展UIStoryboardSegue类并在没有动画的情况下将代码添加到presentModalViewController来创建自定义segue。这是上述问题的解决方案。

#import "ModalViewWithoutAnimation.h"

@implementation ModalViewWithoutAnimation 
- (void)perform {
  [self.sourceViewController presentModalViewController:self.destinationViewController animated:NO]; 
} 
@end

由于

相关问题