问题
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