【发布时间】:2020-01-15 18:40:35
【问题描述】:
performActionFor shortcutItem 如果应用程序已经启动,则会在我的 SceneDelegate 中调用,但如果应用程序实际上从快捷方式项启动,则不会调用它。这是为什么呢?
【问题讨论】:
标签: ios cocoa-touch ios13 uiscene uiscenedelegate
performActionFor shortcutItem 如果应用程序已经启动,则会在我的 SceneDelegate 中调用,但如果应用程序实际上从快捷方式项启动,则不会调用它。这是为什么呢?
【问题讨论】:
标签: ios cocoa-touch ios13 uiscene uiscenedelegate
当从快捷项目启动应用程序时(并且当后台没有应用程序实例时),您可以从sceneDelegate中的willConnectTo函数获取ShortcutItems
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let shortcutItems = connectionOptions.shortcutItem{
}
}
【讨论】: