且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从不同的通知启动苹果手表应用程序的不同屏幕?

更新时间:2023-01-20 12:52:26

当用户点击通知上的按钮时,将始终显示主界面控制器.在主控制器上调用handleActionWithIdentifier:forRemoteNotification:,您可以在那里更新UI.例如,您可以隐藏某些元素,或按其他控制器.

When the user taps a button on the notification, the main interface controller is always displayed. handleActionWithIdentifier:forRemoteNotification: is called on your main controller and you can update the UI there. For example, you could hide certain elements, or push a different controller.

(如果用户点击窗扇,则标识符将为空字符串.)

(If the user taps on the sash, the identifier will be an empty string.)