gpt4 book ai didi

objective-c - 使用 Storyboard在 Xcode 6 os x 应用程序中更改不同的 View

转载 作者:搜寻专家 更新时间:2023-11-01 05:42:26 25 4
gpt4 key购买 nike

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

我想像在 iOS 端做 push segue 一样做。

但 os x 应用程序的新 Xcode Storyboard没有推送转场。

enter image description here

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

最佳答案

我还没有测试过,但我在我的 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;
}];

}

让我知道它是否有效。

关于objective-c - 使用 Storyboard在 Xcode 6 os x 应用程序中更改不同的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26701187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com