reloadRootPageControllers and deep press

你。 提交于 2019-12-25 01:35:40

问题


I'm using reloadRootPageControllers() to remove the top left back button.

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

    // Configure interface objects here.
    WKInterfaceController.reloadRootPageControllers(withNames: ["MainController"], contexts: [], orientation: .horizontal, pageIndex: 0)

}

That works, but when I use a deep press (to show 3 choices) I have the following error:

_puic_setViewControllers:animated: called on while an existing transition or presentation is occurring; the navigation stack will not be updated.

and the thread is freezed.


回答1:


Don't put the reloadRootPageControllers in the Controller.

Replace

pushController(withName: "MainController", context: nil)

By

WKInterfaceController.reloadRootPageControllers(withNames: ["MainController"], contexts: [], orientation: .horizontal, pageIndex: 0)


来源:https://stackoverflow.com/questions/49373924/reloadrootpagecontrollers-and-deep-press

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!