UserNotificationsを実装したLocalNotificationクラスがあります。私は最初のViewControllerと私が提示する必要があるCheckViewControllerの間にsegueを作成しました。それは私のdidReceive responce
FUNCUserNotificationsを使用してViewControllerを提示しました。受信しました
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping() -> Void) { let storyboard = UIStoryboard(name: "Main", bundle: nil) let nav = storyboard.instantiateInitialViewController() as! UINavigationController let mainViewController = nav.topViewController as! ViewController mainViewController.performSegue(withIdentifier: "CheckSegue", sender: nil) }
しかし、まだだ私が得るすべては - 初期のViewControllerです。どこが間違っていますか?
それは作品をお試しください!ありがとう – L1GhTUA
しかし、私は最初のビューではない場合はエラーが発生している – L1GhTUA
ええ、おそらく最初のビューに戻って、これが動作するためにナビゲートする必要があります - 多分、最初のビューに戻ってから、セグを実行しますか? – Samantha