在iOS 13之前,导航控制器和根视图是在AppDelegate中定义的。然而,在iOS 13中,苹果引入了SceneDelegate,它接管了这些视图功能的处理。但是,AppDelegate仍然处理诸如本地通知处理之类的事情。See this answer for some code that outlines these changes for root views. 如果我想在用户点击本地通知时推送视图,我会在AppDelegate中执行类似以下操作: extension AppDelegate: UNUserNotificationCenterDelegate {
var
当用户点击视图控制器时,我希望显示一个特定的视图控制器。我知道之前有很多关于同一件事的问题,也有很多答案,但似乎没有一个对我有效。下面是我的“AppDelegate”中“didReceiveRemoteNotification”方法中的代码
if(application.applicationState == UIApplicationStateInactive) {
NSLog(@"Inactive");
//Show the view with the content of the push
if(userInfo)
{