<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplicationDelegate/application(_:continue:restorationHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSApplicationDelegate(im)application:continueUserActivity:restorationHandler:"
  },
  "title" : "application(_:continue:restorationHandler:)"
}
-->

# application(_:continue:restorationHandler:)

Returns a Boolean value that indicates if the app successfully recreates the specified activity.

```
@MainActor optional func application(_ application: NSApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void) -> Bool
```

## Parameters

`application`

The app continuing the user activity.

`userActivity`

The activity object containing the data associated with the task the user was performing. Use the data in this object to recreate what the user was doing.

`restorationHandler`

A block to execute if your app creates or fetches objects to perform the task. Calling this block is optional and is only needed when specific objects are capable of continuing the activity. You can copy this block and call it at a later time. When calling a saved copy of the block, you must call it from the app’s main thread. This block has no return value and takes the following parameter:

- `restorableObjects`: An array of [`NSResponder`](/documentation/AppKit/NSResponder) or [`NSDocument`](/documentation/AppKit/NSDocument) objects that you created or fetched in order to perform the operation. The system calls the [`restoreUserActivityState(_:)`](/documentation/AppKit/NSUserActivityRestoring/restoreUserActivityState(_:)) method of each object in the array to perform the operation.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if this method handled continuing the activity; <doc://com.apple.documentation/documentation/Swift/false> to have AppKit attempt to continue the activity.

## Discussion

The app calls this method when it receives the data associated with the user activity. Use the data stored in the `NSUserActivity` object to re-create the user’s activity. This method is your opportunity to update your app so that it can perform the associated task.

If this user activity object was created automatically by having `NSUbiquitousDocumentUserActivityType` in a `CFBundleDocumentTypes` entry, AppKit can automatically restore the <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> in macOS if this method returns <doc://com.apple.documentation/documentation/Swift/false>, or if it is unimplemented. It does this by creating a document of the appropriate type using the URL stored in the <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/userInfo> dictionary under the `NSUserActivityDocumentURLKey`. The system calls the [`NSDocument`](/documentation/AppKit/NSDocument) method [`restoreUserActivityState(_:)`](/documentation/AppKit/NSUserActivityRestoring/restoreUserActivityState(_:)) on the document.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)