44.17 Handling the NSUserActivity Object
The intent handler in the extension has instructed Siri to continue the intent handling process by launching the main SiriPhoto app. When the app is launched by Siri it will be provided the NSUserActivity object for the session containing the intent object. When an app is launched and passed an NSUserActivity object it can be accessed from within the App declaration by adding the onContinueUserActivity() modifier to the ContentView, passing through the activity type and defining the actions to be performed. Within the SiriPhotoApp.swift file, implement these changes as follows:
import SwiftUI
@main
struct SiriPhotoApp: App {
var photoHandler: PhotoHandler = PhotoHandler(userActivity:
NSUserActivity(activityType: "Placeholder"))
var body: some Scene {
...