Prior to iOS 13, navigation controllers and root views were defined in AppDelegate. With iOS 13 however, Apple introduced SceneDelegate, which takes over the handling of these view functions. However, AppDelegate still handles things such as Local Notification Handling. See this answer for some code that outlines these changes for root views.
If I wanted a view to be pushed when a user taps a local notification, I would do the something like the following in AppDelegate:
extension AppDelegate: UNUserNotificationCenterDelegate {
var navigationController: UINavigationController?
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
if response.actionIdentifier == UNNotificationDefaultActionIdentifier { //User taps notification
let vc = MyViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
}
}
However, since the root navigation controller for my project can now be defined in SceneDelegate as of iOS 13, I can't seem to figure out how to push a view within a navigation controller managed by SceneDelegate instead of AppDelegate.