在 segue 中加载第二个应用程序界面

Load second app interface in a segue

基本上我想做的事情如下图所示:

然而,这只会加载中间和第三个界面,第一个界面在底部的圆形指示器上和内部都被隐藏了。

我希望能够加载第二个界面并向左轻扫第一个,向右轻扫第三个。有办法实现吗?

ViewController 的位置没有真正的 "physical" 意义。

一个 segue(箭头)简单地定义了一种从 "this" ViewController 导航到另一个的方式。

http://www.raywenderlich.com/81880/storyboards-tutorial-swift-part-2

可以根据需要创建从一个 ViewController 到其他 ViewController 的尽可能多的转场。您可以命名这些 segues,并从故事板发送事件或特定事件的代码(如滑动手势)中触发您想要的一个。

要获得实际向左滑动视图的动画,需要自定义过渡:

http://mathewsanders.com/animated-transitions-in-swift/

在这里构建我的第一个 Apple Watch 应用 :)

看起来 WKInterfacesController 中内置了类似 UINavigationController 行为的概念。

看看:pushControllerWithName(_:context:)

我从一些文档中发现 here

Hierarchical. This style is suited for apps with more complex data models or apps whose data is more hierarchical. A hierarchical interface always starts with a single root interface controller. In that interface controller, you provide controls that, when tapped, push new interface controllers onto the screen.

编辑: 进一步研究这个。 WatchKit 目前非常受外观的限制。

我能想到的最好的解决方案是添加三个 InterfaceController,中间有 segues。左 -> 主要 -> 右。

然后为 Main 分配自定义 SKInterfaceController:

class InterfaceController: WKInterfaceController {  
  override init() {
    super.init()
    becomeCurrentPage()
  } 
}

这会在开始时创建一个烦人的动画,您会在开始时看到 "Left" 以及如何将 "Main" 动画化。我看不出有什么更好的方法可以尽早做到这一点WatchKit 阶段。