上下文:)被执行:如何presentController(withNames何时显示该阵列的第二屏幕

问题描述 投票:1回答:1
presentController(withNames:["ScreenOne", "ScreenTwo", "ScreenThree"], contexts:nil)

在执行上面的行的情况下,屏幕ScreenOne如下面所:

first page in the array is highlighted

我将如何去获得的第二页是执行上面的线什么时候出现。即ScreenTwo

I want second page to show up in the array like this

swift xcode swift3 watchkit wkinterfacecontroller
1个回答
0
投票

如果你想显示另一个页面,你需要插入,在选择控制装置的呼叫到awakebecomeCurrentPage()方法。

override func awake(withContext context: Any?) {
    super.awake(withContext: context)

    // Do your stuff with the context and determine if it is the controller to display

    if mustBeDisplayed {
        becomeCurrentPage()
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.