gpt4 book ai didi

iOS 13performActionForshortcutItem 现在不会在启动时在 SceneDelegate 中调用,而是在应用程序启动后调用。为什么?

转载 作者:行者123 更新时间:2023-11-29 05:28:17 27 4
gpt4 key购买 nike

如果应用程序已启动,则

performActionFor ShortcutItem 会在我的 SceneDelegate 中调用,但如果应用程序实际从快捷方式项启动,则不会调用它。这是为什么?

最佳答案

当应用程序从快捷方式项启动时(并且当后台没有应用程序实例时),您可以从 sceneDelegate 中的 willConnectTo 函数获取 ShortcutItems

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let shortcutItems = connectionOptions.shortcutItem{
}
}

关于iOS 13performActionForshortcutItem 现在不会在启动时在 SceneDelegate 中调用,而是在应用程序启动后调用。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57931221/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com