I'm creating a new scene like:
The activity parameter has userInfo that I need in the new scene; for example,
Here's how I'm creating the new scene:
The print statement has an empty userInfo.
What's the problem?
Code Block UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity, options: nil/*options*/) { error in dPrint("\(error)") }
The activity parameter has userInfo that I need in the new scene; for example,
Code Block activity.userInfo = ["sampleKey":"sampleData"]
Here's how I'm creating the new scene:
Code Block func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene else { return } window = UIWindow(windowScene: windowScene) window?.rootViewController = ContainerViewController(to: createSplitViewController()) window?.makeKeyAndVisible() scene.title = SystemData.appName if appDelegate.isOnboardingNeeded, let containerController = window?.rootViewController as? ContainerViewController { appDelegate.launchOnboardingIfNeeded(with: containerController) } if let activity = connectionOptions.userActivities.first ?? session.stateRestorationActivity { dPrint("\(#function) \(activity)") masterViewController?.restore(from: activity, isStandalone: false, persistentId: scene.session.persistentIdentifier) } }
The print statement has an empty userInfo.
What's the problem?