简体   繁体   English

如何在Apple Watch的基于页面的导航中选择中间的InterfaceController?

[英]How to segue to the middle InterfaceController in Page Based Navigation on Apple Watch?

I am trying to build a similar flow to the Apple Watch Workout App where after you begin a workout you are presented with an InterfaceController showing the duration and you scan swipe left to see an additional InterfaceController or swipe right to end the workout etc. on another InterfaceController. 我正在尝试构建与Apple Watch Workout App类似的流程,在开始锻炼之后,您会看到一个显示持续时间的InterfaceController,然后向左扫描以查看其他InterfaceController或向右滑动以结束锻炼等。 InterfaceController。 However (below) I cannot swipe right to see the IC on the left to end the workout. 但是(在下面)我无法向右滑动以查看左侧的IC以结束锻炼。 How can I achieve this so that the user is placed in the 2nd IC of the navigation stack without a hack solution such as if I'm presented from the initial InterfaceController auto reload to IC #2? 我如何才能做到这一点,以使用户被放置在导航堆栈的第二个IC中而没有黑客解决方案,例如如果我是从最初的InterfaceController自动重载到IC#2出现的呢?

在此处输入图片说明

Not sure if it's possible to do it in the storyboard as I was attempting, but figured out how to do exactly what I wanted via code: 不知道是否有可能像我正在尝试的那样在情节提要中执行此操作,但是想出了如何通过代码正确执行我想要的操作:

    WKInterfaceController.reloadRootPageControllers(withNames: ["testIC1", "testIC2", "testIC3"],
                                                    contexts: [contextDictionary],
                                                    orientation: .horizontal,
                                                    pageIndex: 1)
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM