【问题标题】:Changing different views in Xcode 6 os x application using Storyboards使用 Storyboards 在 Xcode 6 os x 应用程序中更改不同的视图
【发布时间】:2014-12-29 08:07:42
【问题描述】:

我正在查看适用于 os x 应用程序的新 Xcode 6 Storyboards

我想在 iOS 端做 push segue 时做同样的事情。

但是用于 os x 应用程序的新 Xcode 故事板没有 push segue。

所以你可以看到没有推送。如何实现相同的功能?

【问题讨论】:

  • 你可以尝试自定义segue。
  • 感谢@carlodurso。你知道这方面的例子吗?

标签: objective-c xcode cocoa swift xcode6


【解决方案1】:

我还没有测试过,但我在我的 iPad 应用上使用了类似的方法。它需要对 Cocoa 进行一些剪裁:

-(void) perform {

    UIView *source = ((UIViewController *)self.sourceViewController).view;
    UIView *destination = ((UIViewController *)self.destinationViewController).view;

    UIWindow *window = [[[UIApplication sharedApplication] delegate] window];
    destination.center = CGPointMake(source.center.x + source.frame.size.width, destination.center.y);
    [window insertSubview:destination aboveSubview:source];

    [UIView animateWithDuration:0.4
                     animations:^{
                         destination.center = CGPointMake(source.center.x, destination.center.y);
                         source.center = CGPointMake(0- source.center.x, destination.center.y);}
                     completion:^(BOOL finished){
                         [source removeFromSuperview];
                         window.rootViewController = self.destinationViewController;
                     }];

}     

让我知道它是否有效。

【讨论】:

  • 我会测试并告诉你。谢谢卡洛杜索
【解决方案2】:

根据您要执行的操作,NSTabViewController 可能是合适的。它延迟加载视图控制器并可以使用幻灯片动画进行转换。

【讨论】:

  • 谢谢 Pierre Bernard,我会试一试
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-10-05
相关资源
最近更新 更多