gpt4 book ai didi

ios - 如何在通知操作中显示特定的 View Controller ?

转载 作者:行者123 更新时间:2023-11-30 12:12:03 26 4
gpt4 key购买 nike

如何在通知操作中显示特定的 View Controller ?在应用程序委托(delegate)中

func usernotificationcenter(_center: UNUserNotification,didReceive response: UNNotificationPesponse,withCompletionHalndler completion Handler: @escaping () -> Void){ 

if identifer == "SHOWVIEW_ACTION":
//I want show specific viewController at this

}

最佳答案

func redirectToSpecificVC() {
let mainStoryboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewController: UIViewController = mainStoryboard.instantiateViewController(withIdentifier: "versesVC") as UIViewController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = initialViewController
self.window?.makeKeyAndVisible()}

使用这些函数重定向到特定的 View Controller

关于ios - 如何在通知操作中显示特定的 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45930121/

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