WKInterfaceButton 同时推送 segue 和 action

WKInterfaceButton simultaneous push segue and action

为什么当 WKInterfaceButton 同时连接到推送转场和动作时,动作没有被调用?

当然,当您执行 segue 时,旧的 InterfaceController 会离开屏幕。 WatchOS 似乎破坏了您的扩展和应用程序之间的桥梁(storyboard/interface)。同样的事情发生在另一个方向。扩展无法修改不在屏幕上的 UI。例如 UI 属性。在界面控制器离开屏幕后尝试设置标签的颜色。不行。

来自文档:

Important

An interface controller can make changes to its interface only during initialization and when the interface is active. Once the didDeactivate() method is called, any attempts to change the value of related interface objects are ignored until the interface controller’s willActivate() method is called again.

想必您是 iOS 开发者。通读 https://developer.apple.com/reference/watchkit/wkinterfacecontroller

可能会很好

自从我开始学习 watchOS 以来,我的很多 assumptions/experience 并没有很好地转化到手表上。