を扱う画面の遅れにつながる、私はいくつかの地元のプッシュ通知を登録したとき、私は奇妙な問題に気づいた:LGSideMenuController:複数のローカルプッシュ通知の登録は
for model in myModelArray
{
let calendar = Calendar.current
let scheduleDate = calendar.date(byAdding: .second, value: i * 5, to: Date())!
let notification = UILocalNotification()
notification.fireDate = scheduleDate
notification.alertBody = "My push notification title"
UIApplication.shared.scheduleLocalNotification(notification)
i += 1
}
私の地元のプッシュ通知は、バックグラウンドモードで表示されたら、私は上のタップ
func application(_ application: UIApplication, didReceive notification: UILocalNotification)
{
let mainMenuVC = self.window?.rootViewController as! MenuViewController
let navController = mainMenuVC.sideMenuController?.rootViewController as! UINavigationController
let myDestinationVC = navController.storyboard?.instantiateViewController(withIdentifier: "MyIdentifier") as! MyDestinationViewController
navController.pushViewController(mydestinationVC, animated: false)
}
しかし、私のmenuVCと私のdestinationVCとの間の移行が起こるまでには最大1分かかります。私のアプリが開かれたら、View Controllerを押すことは完全に機能します。私は何かを忘れましたか?私のコードで何が間違っていますか?この遅延は、アプリが終了してからプッシュ通知をタップした後に再び開いたときにのみ発生します。
ありがとうございます!なぜこのコンパイラ警告はこの非推奨を示していないのですか?どのような厄介なバグ。デリゲートメソッドが起動しない唯一のケースは、アプリケーションが終了したときです。 iOS10の通知処理を調整します。 –